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..ac81d2325d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,64 @@ +name: Bug report +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+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 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 + +- 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: + - New Save Format (NSF) + - The bug also exists in RCT2 (vanilla) + - This bug is specific to multiplayer + - Building the game + validations: + required: false + +- type: textarea + attributes: + label: Steps to reproduce + 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. + 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..44ccf896eb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +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. +- name: OpenRCT2 Discord Server + url: https://discord.gg/ZXZd8D8 + about: For help with running or playing the game, join our Discord server. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14fac2badb..82e3b10e1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,52 +115,38 @@ 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 (x64) using CMake + name: macOS (${{ matrix.arch }}) using CMake runs-on: macos-latest needs: check-code-formatting + strategy: + fail-fast: false + matrix: + arch: [x64, arm64] + include: + - 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 + 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,9 +159,55 @@ 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 }}-x64-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 + - 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/CMakeLists.txt b/CMakeLists.txt index 2c49933f6d..bc6cf198d4 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) @@ -50,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.43") +set(REPLAYS_VERSION "0.0.57") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "269E4FC432A73AE9A5D601EC2A1C882F3D9BDF3C") +set(REPLAYS_SHA1 "DF9C3B48755B19FDD4D0EC721007B98CD5B6F420") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") @@ -110,9 +125,9 @@ 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") + set(MACOS_DYLIBS_VERSION "29") + set(MACOS_DYLIBS_ZIPFILE "openrct2-libs-v${MACOS_DYLIBS_VERSION}-universal-macos-dylibs.zip") + 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}") @@ -209,6 +224,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 +387,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/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj deleted file mode 100644 index b6e6699cb4..0000000000 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ /dev/null @@ -1,4737 +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 */; }; - 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 */; }; - 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 */; }; - 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 */; }; - 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 */; }; - 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 */; }; -/* 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 = ""; }; - 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 = ""; }; - 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 = ""; }; - 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 = ""; }; - 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 = ""; }; - 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 = ""; }; - 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 = ""; }; - 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; }; -/* 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 = ( - 93DFD03B24521C19001FCBAF /* Duktape.hpp */, - 93DFD03524521C19001FCBAF /* HookEngine.cpp */, - 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 */, - 93DFD03824521C19001FCBAF /* ScriptEngine.cpp */, - 93DFD04324521C19001FCBAF /* ScriptEngine.h */, - 93DFD03624521C19001FCBAF /* ScTile.hpp */, - ); - 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 */, - ); - 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 */, - F76C838E1EC4E7CC00FA49E2 /* Nullable.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 */, - ); - 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 */, - 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 */, - ); - 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 */, - ); - 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 */, - C666EE5D1F37ACB10061AA04 /* MusicCredits.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 = ""; - }; -/* 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 */, - 93DFD05524521C1A001FCBAF /* ScMap.hpp 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 */, - 93DFD05124521C1A001FCBAF /* ScContext.hpp 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 */, - 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 */, - 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 */, - 93DFD04A24521C1A001FCBAF /* ScConfiguration.hpp 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 */, - 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 */, - 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 */, - 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 */, - 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 */, - 93DFD04724521C1A001FCBAF /* ScNetwork.hpp 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 */, - ); - 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 */, - 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 */, - 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 */, - C666EE731F37ACB10061AA04 /* MusicCredits.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 */, - ); - 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.13; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - C68B2D451EC790690020651C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; - 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.13; - 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.13; - 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.13; - 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.13; - 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.13; - 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.13; - 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/contributors.md b/contributors.md index 4213c6d9ad..2562ce29e3 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 @@ -91,8 +91,9 @@ 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 ## Bug fixes * (KirilAngelov) @@ -172,6 +173,12 @@ 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) +* Saad Rehman (SaadRehmanCS) +* (ocalhoun6) +* Sean Payne (seanmajorpayne) +* Soham Roy (sohamroy19) +* Gaven Rendell (Rendello) ## Toolchain * (Balletie) - macOS @@ -182,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) diff --git a/data/language/ar-EG.txt b/data/language/ar-EG.txt index d38d4004eb..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 @@ -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..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. @@ -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..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 @@ -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..934a78b131 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 @@ -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 @@ -3291,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: @@ -3682,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 # @@ -4201,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 @@ -4246,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 diff --git a/data/language/de-DE.txt b/data/language/de-DE.txt index 9e5b5c57fc..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 @@ -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 @@ -3692,6 +3647,12 @@ 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 … +STR_6456 :Riesiger Screenshot +STR_6457 :Einen Fehler auf GitHub melden +STR_6458 :Dies in Hauptansicht folgen ############# # Scenarios # diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 3813f7521e..e3c577fa64 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 @@ -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 @@ -3696,6 +3651,11 @@ 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… +STR_6456 :Giant Screenshot +STR_6457 :Report a bug on GitHub +STR_6458 :Follow this on Main View ############# # Scenarios # diff --git a/data/language/eo-OO.txt b/data/language/eo-OO.txt index 5b6eb0bd92..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 @@ -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 @@ -3696,6 +3651,11 @@ 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 +STR_6457 :Raporti cimon sur GitHub +STR_6458 :Sekvi ĉi tion en Ĉefa Vido ############# # Scenarios # diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index 3896f289ec..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 @@ -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 @@ -2875,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. @@ -3431,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}❌ @@ -3649,12 +3604,26 @@ 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 +STR_6457 :Informar un error en GitHub +STR_6458 :Siga esto en la Vista Principal + ############## # Escenarios # ############## diff --git a/data/language/fi-FI.txt b/data/language/fi-FI.txt index fb3ca39e84..147718d011 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}{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 @@ -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 @@ -2197,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 @@ -3630,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 @@ -3689,6 +3644,24 @@ 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 +STR_6454 :Banneria ei voi uudelleennimetä… +STR_6455 :Kylttiä ei voi uudelleennimetä… +STR_6456 :Jättiruudunkaappaus +STR_6457 :Ilmoita viasta GitHubissa ############# # Scenarios # @@ -4497,4 +4470,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..e2bc56b575 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 ! @@ -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 @@ -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 @@ -3703,6 +3658,11 @@ 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… +STR_6456 :Capture d’écran géante +STR_6457 :Signaler un bug sur GitHub +STR_6458 :Suivre sur la vue principale ############# # Scenarios # diff --git a/data/language/hu-HU.txt b/data/language/hu-HU.txt index 1080211dd0..1ea2fd90b5 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 @@ -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 @@ -3639,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 ############# diff --git a/data/language/it-IT.txt b/data/language/it-IT.txt index 692635e7c2..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 @@ -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 @@ -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 @@ -2112,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 @@ -2559,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 @@ -2798,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 @@ -3646,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. @@ -3704,6 +3659,11 @@ 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 +STR_6457 :Segnala un bug su GitHub +STR_6458 :Segui sulla visuale principale ############# 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 32dd21608e..b49c37e449 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 :수중에만 건설할 수 있습니다! @@ -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종의 다른 롤러코스터를 공원에 운용하세요 @@ -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 @@ -2408,7 +2363,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 :공원/시나리오 상세 설명 @@ -3699,6 +3654,11 @@ STR_6450 :{BLACK}“{STRING}” STR_6451 :{BLACK}“{STRING}” - {STRING} STR_6452 :{WINDOW_COLOUR_2}판매: {BLACK}{STRING} STR_6453 :버전 정보 복사 +STR_6454 :팻말 이름을 변경할 수 없습니다… +STR_6455 :팻말 이름을 변경할 수 없습니다… +STR_6456 :초대형 스크린 샷 +STR_6457 :GitHub에 버그 제보 +STR_6458 :따라가기 ############# # Scenarios # @@ -4005,8 +3965,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/nb-NO.txt b/data/language/nb-NO.txt index 54068654b7..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 @@ -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..32bdf20312 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 @@ -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 @@ -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 @@ -2944,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 + @@ -3014,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… @@ -3694,6 +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_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 # @@ -3718,7 +3679,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 @@ -3738,7 +3699,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 @@ -3748,12 +3709,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 @@ -3773,12 +3734,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 @@ -3793,12 +3754,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 @@ -3819,12 +3780,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 @@ -3879,7 +3840,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 @@ -4156,17 +4117,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 @@ -4176,22 +4137,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 @@ -4270,160 +4231,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 diff --git a/data/language/pl-PL.txt b/data/language/pl-PL.txt index f23c53eacb..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 @@ -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..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 @@ -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 @@ -3696,6 +3651,11 @@ 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 +STR_6457 :Relatar um problema pelo GitHub +STR_6458 :Seguir isto na Visão Principal ############# # Scenarios # diff --git a/data/language/ru-RU.txt b/data/language/ru-RU.txt index 93b52e608c..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 @@ -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..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 @@ -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..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 @@ -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..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 @@ -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..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 @@ -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 0d8ec78805..83e83b4ce6 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 :視窗化 @@ -2055,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 @@ -2422,8 +2381,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 +2833,7 @@ STR_5554 :啟用山丘工具 STR_5555 :顯示來自其他類型軌道的車輛種類 STR_5556 :踢除玩家 STR_5557 :多人遊戲不同步時依然保持連線 -STR_5558 :此設定會於重啟遊戲後生效 +STR_5558 :此設定只會於重啟OpenRCT2後生效 STR_5559 :檢查時距為10分鐘 STR_5560 :將所有遊樂設施的檢查時距設定為'每10分鐘' STR_5561 :載入語言失敗 @@ -3007,7 +2966,7 @@ STR_5721 :陰天 STR_5722 :有雨 STR_5723 :大雨 STR_5724 :雷暴 -STR_5725 :{BLACK}強制設定天氣為: +STR_5725 :{BLACK}設定天氣為: STR_5726 :設定樂園目前的天氣 STR_5727 :縮放品質: STR_5731 :線性 @@ -3146,7 +3105,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 +3251,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 +3270,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 +3569,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 +4393,10 @@ STR_SCNR :搖滾-搖滾 STR_PARK :搖滾復興 STR_DTLS :這個過時的主題樂園曾經有過輝煌的日子。請協助所有者將讓這個主題樂園再次搖滾起來,讓這個地方成為成功的企業。 +############################################################################### +## Official Custom Content Scenarios +############################################################################### + +STR_SCNR :Panda World +STR_PARK :Panda World +STR_DTLS :在這以熊貓為主題的樂園中增加更多遊樂設施以吸引更多遊客到訪 diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 2ce75c15bd..b02474d504 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,3 +1,63 @@ +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. +- 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: [#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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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) ------------------------------------------------------------------------ - Fix: [#15028] Crash when placing large scenery. diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 72efec0980..da94ea7000 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; } @@ -267,6 +268,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 +367,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" | @@ -515,6 +517,13 @@ declare global { result: boolean; } + type VehicleCrashIntoType = "another_vehicle" | "land" | "water"; + + interface VehicleCrashArgs { + readonly id: number; + readonly crashIntoType: VehicleCrashIntoType; + } + /** * APIs for the in-game date. */ @@ -562,7 +571,15 @@ 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[]; + getAllEntities(type: "car"): Car[]; + getAllEntities(type: "litter"): Litter[]; + createEntity(type: EntityType, initializer: object): Entity; } type TileElementType = @@ -1019,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"; @@ -1056,8 +1078,13 @@ declare global { "jumping_fountain_water" | "litter" | "money_effect" | - "peep" | - "steam_particle"; + "guest" | + "staff" | + "steam_particle" | + /** + * @deprecated since version 34, use guest or staff instead. + */ + "peep"; /** * Represents an object "entity" on the map that can typically moves and has a sub-tile coordinate. @@ -1068,7 +1095,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; /** @@ -1206,10 +1233,16 @@ declare global { readonly remainingDistance: number; /** - * List of peep IDs ordered by seat. + * 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 @@ -1253,6 +1286,7 @@ declare global { /** * Represents a guest or staff member. + * @deprecated since version 34, use guest or staff instead. */ interface Peep extends Entity { /** @@ -1321,6 +1355,9 @@ declare global { "iceCream" | "hereWeAre"; + /** + * @deprecated since version 34, use EntityType instead. + */ type PeepType = "guest" | "staff"; /** @@ -1411,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; } /** @@ -1440,6 +1492,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. + */ + creationTick: 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. @@ -1692,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/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. 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 diff --git a/openrct2.proj b/openrct2.proj index 999ffe9873..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.43/replays.zip - 269E4FC432A73AE9A5D601EC2A1C882F3D9BDF3C + https://github.com/OpenRCT2/replays/releases/download/v0.0.57/replays.zip + DF9C3B48755B19FDD4D0EC721007B98CD5B6F420 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: diff --git a/resources/g2/icons/path_railings_tab.png b/resources/g2/icons/path_railings_tab.png new file mode 100644 index 0000000000..ffac83ff40 Binary files /dev/null and b/resources/g2/icons/path_railings_tab.png differ 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/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} diff --git a/src/openrct2-ui/CMakeLists.txt b/src/openrct2-ui/CMakeLists.txt index ce14758338..e1545cbd4b 100644 --- a/src/openrct2-ui/CMakeLists.txt +++ b/src/openrct2-ui/CMakeLists.txt @@ -35,6 +35,17 @@ 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 + # 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 () endif () # Outputs @@ -141,7 +152,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 +159,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}") 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; } 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-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/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 9031f447a1..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 @@ -296,7 +300,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); } } @@ -523,6 +527,15 @@ public: #endif case SDL_KEYDOWN: { +#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; + } +#endif _textComposition.HandleMessage(&e); auto ie = GetInputEventFromSDLEvent(e); ie.State = InputEventState::Down; @@ -860,8 +873,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 +894,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 +916,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/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/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 7e483bb5e7..fdc312becc 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: @@ -158,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: @@ -186,9 +181,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: @@ -258,7 +253,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); @@ -266,7 +261,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: @@ -345,13 +341,13 @@ public: if (w == nullptr || w->number != rideIndex) { window_close_construction_windows(); - _currentRideIndex = rideIndex; - w = OpenWindow(WC_RIDE_CONSTRUCTION); + _currentRideIndex = static_cast(rideIndex); + OpenWindow(WC_RIDE_CONSTRUCTION); } else { ride_construction_invalidate_current_track(); - _currentRideIndex = rideIndex; + _currentRideIndex = static_cast(rideIndex); } break; } @@ -397,7 +393,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, EnumValue(vehicle->ride)); if (w == nullptr) return; 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/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); 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/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/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 3617123463..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,26 +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 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 @@ -134,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; @@ -144,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; @@ -165,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 } }); } } @@ -297,6 +293,7 @@ public: assert(_screenFramebuffer != nullptr); _drawingContext->StartNewDraw(); + _drawingContext->CalculcateClipping(&_bitsDPI); } void EndDraw() override @@ -334,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); } @@ -358,9 +358,8 @@ public: // Not applicable for this engine } - IDrawingContext* GetDrawingContext(rct_drawpixelinfo* dpi) override + IDrawingContext* GetDrawingContext() override { - _drawingContext->SetDPI(dpi); return _drawingContext; } @@ -540,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; @@ -577,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; @@ -598,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 }; @@ -608,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) @@ -617,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) @@ -643,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; } @@ -663,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; } @@ -677,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; @@ -758,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) @@ -789,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; @@ -818,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; @@ -869,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) { @@ -893,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; @@ -922,6 +939,51 @@ void OpenGLDrawingContext::DrawGlyph(uint32_t image, int32_t x, int32_t y, const command.depth = _drawCount++; } +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; + 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); @@ -998,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(); @@ -1016,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-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 { diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp index fbd919d337..11fe0029c8 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) @@ -187,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 }); } } @@ -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..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++) @@ -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-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 d4c15a7b31..0b1f85a17f 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; } /** @@ -198,27 +194,27 @@ static void InputScrollDragContinue(const ScreenCoordsXY& screenCoords, rct_wind rct_widgetindex widgetIndex = _dragWidget.widget_index; uint8_t scrollIndex = _dragScrollIndex; - rct_widget* widget = &w->widgets[widgetIndex]; - rct_scroll* scroll = &w->scrolls[scrollIndex]; + const auto& widget = w->widgets[widgetIndex]; + 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) + int16_t size = widget.width() - 1; + 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) + int16_t size = widget.height() - 1; + 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); @@ -608,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; @@ -621,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; @@ -632,44 +626,44 @@ static void InputScrollBegin(rct_window* w, rct_widgetindex widgetIndex, const S return; } - rct_widget* widg = &w->widgets[widgetIndex]; - rct_scroll* scroll = &w->scrolls[scroll_id]; + const auto& widg = w->widgets[widgetIndex]; + auto& scroll = w->scrolls[scroll_id]; - int32_t widget_width = widg->width() - 1; - if (scroll->flags & VSCROLLBAR_VISIBLE) + 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_content_width = std::max(scroll.h_right - widget_width, 0); - int32_t widget_height = widg->bottom - widg->top - 1; - if (scroll->flags & HSCROLLBAR_VISIBLE) + 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); + 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; @@ -680,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) { @@ -694,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) { @@ -750,33 +743,34 @@ 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]; + auto& scroll = w->scrolls[scroll_id]; - 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; + newLeft = scroll.h_right; newLeft *= x; - x = widget->width() - 21; - if (w->scrolls[scroll_id].flags & VSCROLLBAR_VISIBLE) + x = widget.width() - 21; + 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) + x = widget.width() - 1; + 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); } @@ -789,33 +783,34 @@ 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]; + auto& scroll = w->scrolls[scroll_id]; - 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; + newTop = scroll.v_bottom; newTop *= y; - y = widget->height() - 21; - if (w->scrolls[scroll_id].flags & HSCROLLBAR_VISIBLE) + y = widget.height() - 21; + 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) + y = widget.height() - 1; + 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); } @@ -828,11 +823,12 @@ 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) - 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); } @@ -845,20 +841,21 @@ 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]; - if (window_find_by_number(w->classification, w->number)) + 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; - if (w->scrolls[scroll_id].flags & VSCROLLBAR_VISIBLE) + auto& scroll = w->scrolls[scroll_id]; + scroll.flags |= HSCROLLBAR_RIGHT_PRESSED; + scroll.h_left += 3; + int32_t newLeft = widget.width() - 1; + 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); } @@ -871,11 +868,12 @@ 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) - 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); } @@ -888,20 +886,21 @@ 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]; - if (window_find_by_number(w->classification, w->number)) + 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; - if (w->scrolls[scroll_id].flags & HSCROLLBAR_VISIBLE) + auto& scroll = w->scrolls[scroll_id]; + scroll.flags |= VSCROLLBAR_DOWN_PRESSED; + scroll.v_top += 3; + int32_t newTop = widget.height() - 1; + 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); } @@ -1004,7 +1003,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) { @@ -1030,9 +1028,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: @@ -1064,7 +1062,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; @@ -1174,7 +1172,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); @@ -1204,7 +1202,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)) @@ -1241,7 +1240,7 @@ void InputStateWidgetPressed( case MouseState::RightPress: if (_inputState == InputState::DropdownActive) { - if (w) + if (w != nullptr) { auto wClass = w->classification; auto wNumber = w->number; @@ -1321,10 +1320,10 @@ void InputStateWidgetPressed( gTooltipTimeout = 0; gTooltipWidget.widget_index = cursor_widgetIndex; - if (!w) + if (w == nullptr) break; - if (!widget) + if (widget == nullptr) break; { @@ -1619,11 +1618,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/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/ShortcutInput.cpp b/src/openrct2-ui/input/ShortcutInput.cpp index 0e22095bba..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; } @@ -152,11 +148,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; } } } @@ -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/input/ShortcutManager.cpp b/src/openrct2-ui/input/ShortcutManager.cpp index d729ea8b30..f7f24002fa 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); @@ -234,23 +234,21 @@ std::optional ShortcutManager::ConvertLegacyBinding(uint16_t bind if (binding == nullBinding) { - return {}; - } - 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; + return std::nullopt; } + + 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) @@ -273,9 +271,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/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 6e604ec79b..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); @@ -711,6 +711,7 @@ static void ShortcutToggleTransparentWater() gConfigGeneral.transparent_water ^= 1; config_save_default(); + gfx_invalidate_screen(); } #pragma endregion @@ -728,7 +729,7 @@ void ShortcutManager::RegisterDefaultShortcuts() { window_close_all(); } - else if (gS6Info.editor_step == EditorStep::LandscapeEditor) + else if (gEditorStep == EditorStep::LandscapeEditor) { window_close_top(); } @@ -772,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-ui/interface/Graph.cpp b/src/openrct2-ui/interface/Graph.cpp index 85b3272264..d355de70b1 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,12 +159,13 @@ 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)]; + 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 @@ -176,14 +178,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 +208,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 +235,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 +249,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; } @@ -259,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); @@ -270,7 +273,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..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 @@ -18,8 +17,6 @@ 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 - -#endif diff --git a/src/openrct2-ui/interface/LandTool.cpp b/src/openrct2-ui/interface/LandTool.cpp index 4019c4486d..f6a0a0deb4 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) { @@ -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/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/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 192d04d23a..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 @@ -743,10 +739,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 5bd98c98fc..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 @@ -63,7 +64,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( @@ -79,11 +80,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) @@ -250,7 +249,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( @@ -375,7 +374,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); @@ -423,15 +422,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; @@ -709,11 +712,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; @@ -757,7 +760,7 @@ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoo if (window == nullptr || window->viewport == nullptr) { CoordsXY ret{}; - ret.setNull(); + ret.SetNull(); return ret; } auto viewport = window->viewport; @@ -767,7 +770,7 @@ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoo if (info.SpriteType == ViewportInteractionItem::None) { - initialPos.setNull(); + initialPos.SetNull(); return initialPos; } diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 4c883a04c7..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); /** @@ -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,20 +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 - 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); 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; @@ -489,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; - r = w->windowPos.x + widget->right; - 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); @@ -525,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 }; @@ -573,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; @@ -587,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 }); } /** @@ -610,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); @@ -637,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); @@ -652,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]; - rct_scroll* scroll = &w->scrolls[scrollIndex]; + const auto& widget = w->widgets[widgetIndex]; + const auto& 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); @@ -672,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++; @@ -703,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; @@ -717,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 @@ -730,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), {}); @@ -738,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), {}); @@ -755,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 @@ -769,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), {}); } @@ -793,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); } @@ -918,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; @@ -930,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; } @@ -954,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; } @@ -967,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); } @@ -992,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; } @@ -1018,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; } } } @@ -1088,14 +1085,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; @@ -1104,13 +1101,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 }); @@ -1146,7 +1143,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 bf11d1c644..5e3774a544 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 @@ -112,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) @@ -132,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) { @@ -157,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) { @@ -274,11 +275,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->focus = std::nullopt; w->page = 0; w->var_48C = 0; w->var_492 = 0; @@ -360,25 +357,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); @@ -398,8 +395,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,12 +539,12 @@ 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]; - 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; @@ -581,7 +578,6 @@ void ApplyScreenSaverLockSetting() void WindowInitScrollWidgets(rct_window* w) { rct_widget* widget; - rct_scroll* scroll; int32_t widget_index, scroll_index; int32_t width, height; @@ -595,20 +591,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); @@ -755,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/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/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/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{}; diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index fd0a123a30..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; @@ -62,7 +63,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; @@ -354,17 +355,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]; } } } @@ -788,12 +787,7 @@ 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); + viewport_create(this, { left, top }, wwidth, wheight, Focus(CoordsXYZ(0, 0, 0))); flags |= WF_NO_SCROLLING; Invalidate(); } @@ -972,7 +966,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/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 850d180378..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) @@ -139,7 +137,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 +145,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 +162,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 diff --git a/src/openrct2-ui/scripting/ScTitleSequence.hpp b/src/openrct2-ui/scripting/ScTitleSequence.hpp index 4e5d889015..0d9e80db33 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,9 +208,9 @@ 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()); + objectMgr.LoadObjects(result.RequiredObjects); parkImporter->Import(); auto old = gLoadKeepWindowsOpen; @@ -249,7 +248,7 @@ namespace OpenRCT2::Scripting return i; } } - return {}; + return std::nullopt; } }; @@ -490,7 +489,7 @@ namespace OpenRCT2::Scripting return i; } } - return {}; + return std::nullopt; } const TitleSequenceManagerItem* GetItem() const 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/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/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-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index f7f776689b..c068081b12 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 \ @@ -73,13 +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, - MakeWidget({100, WH - TABHEIGHT}, {200, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_MUSIC_ACKNOWLEDGEMENTS_ELLIPSIS), // music credits button - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget *window_about_page_widgets[] = { @@ -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/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 8a7f372593..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 @@ -74,7 +74,6 @@ static rct_widget window_banner_widgets[] = { class BannerWindow final : public Window { private: - Banner* _banner; CoordsXYZ _bannerViewPos; void CreateViewport() @@ -82,7 +81,7 @@ private: rct_widget* viewportWidget = &window_banner_widgets[WIDX_VIEWPORT]; 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(_bannerViewPos)); if (viewport != nullptr) viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; @@ -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); 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/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 61bdc07687..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 @@ -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/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 03ad9bb394..06b3ceabe4 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[] = @@ -239,13 +239,13 @@ 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 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[] = @@ -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[] = { @@ -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); @@ -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; @@ -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: @@ -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/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 4875ccd888..7d64277f4b 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,209 +28,184 @@ 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 - { WIDGETS_END }, + 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; + + Invalidate(); + } + + 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, ScreenCoordsXY(context_get_width() - WW, 29), WW, WH, 0); - gLandToolSize = 2; - gClearSceneryCost = MONEY32_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) -{ - 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); -} - -/** - * - * 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) - { - DrawTextBasic( - dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &gLandToolSize, { TextAlignment::CENTRE }); - } - - // Draw cost amount - if (gClearSceneryCost != MONEY32_UNDEFINED && gClearSceneryCost != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) - { - 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 }); - } + return nullptr; } diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 73772f03a3..b1a00bbb46 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -35,11 +35,11 @@ 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 ), - { WIDGETS_END }, + 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, }; @@ -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; } @@ -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); @@ -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/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 e79477b548..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); @@ -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->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 = ride->id; + w->rideId = 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(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(w->number); + auto ride = get_ride(w->rideId); ride_action_modify(ride, RIDE_MODIFY_RENEW, GAME_COMMAND_FLAG_APPLY); break; } @@ -161,13 +161,13 @@ 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(w->rideId); if (ride != nullptr) { 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 }); @@ -178,13 +178,13 @@ 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(w->rideId); if (ride != nullptr) { 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/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index a8ea39dd92..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 @@ -33,7 +34,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; @@ -157,7 +158,7 @@ void WindowDropdownShowTextCustomWidth( if (gDropdownNumItems == 0) { _dropdown_num_columns = 1; - _dropdown_num_rows = 0; + _dropdown_num_rows = 1; } else { @@ -231,15 +232,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++; @@ -286,90 +287,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 }); } diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 62f4d61997..10f0282b32 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); @@ -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[] = { @@ -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; } @@ -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) && 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, - 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); } } @@ -421,7 +420,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 +431,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 +455,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 +463,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 +484,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/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 527cba02aa..a3d911b202 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 @@ -155,14 +155,14 @@ 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) { 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; @@ -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); } /** @@ -607,10 +607,10 @@ 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.Equals(&_editorInventionsListDraggedItem)) + if (researchItem == _editorInventionsListDraggedItem) continue; // TODO: this parameter by itself produces very light text. diff --git a/src/openrct2-ui/windows/EditorMain.cpp b/src/openrct2-ui/windows/EditorMain.cpp index 2df57c7f7a..fdd0411203 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, }; /** @@ -40,14 +40,14 @@ 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); + viewport_create(window, window->windowPos, window->width, window->height, Focus(CoordsXYZ(0x0FFF, 0x0FFF, 0))); window->viewport->flags |= 0x0400; gCurrentRotation = 0; 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); @@ -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/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 7048fc880f..c8c6815ba5 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -107,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 @@ -167,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 @@ -210,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); @@ -456,6 +463,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; @@ -686,7 +698,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. @@ -704,7 +716,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; @@ -749,7 +761,10 @@ static void window_editor_object_selection_scroll_mouseover( w->selected_list_item = selectedObject; if (_loadedObject != nullptr) + { _loadedObject->Unload(); + _loadedObject = nullptr; + } if (selectedObject == -1) { @@ -818,20 +833,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 @@ -839,16 +856,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; } } @@ -942,8 +959,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()); @@ -1061,35 +1078,38 @@ 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); } } - 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) { 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]; @@ -1100,17 +1120,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 @@ -1128,25 +1148,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) @@ -1155,12 +1175,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); @@ -1169,7 +1188,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); @@ -1180,6 +1199,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 @@ -1208,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 @@ -1330,7 +1350,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++) @@ -1444,14 +1464,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) @@ -1603,6 +1621,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/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 5d0759806f..1afefb10ab 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -102,18 +102,18 @@ 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[] = { 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 @@ -371,15 +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, 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; } @@ -790,7 +791,6 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi { int32_t width; rct_string_id stringId; - uint32_t arg; WindowDrawWidgets(w, dpi); window_editor_objective_options_draw_tab_images(w, dpi); @@ -801,8 +801,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 +837,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 +877,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 +890,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,9 +900,9 @@ 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); + ft.Add(gScenarioName.c_str()); DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft); // Scenario details label @@ -912,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 @@ -921,8 +924,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[gScenarioCategory]); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } /** @@ -968,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] = EnumValue(ride.id); numItems++; } } @@ -1001,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; @@ -1090,11 +1095,12 @@ 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 - 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/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 2647f982c0..756193278b 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,13 +165,13 @@ 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[] = { 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 @@ -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,46 +682,53 @@ 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 }; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &gInitialCash); + 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 }; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &gBankLoan); + 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 }; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &gMaxBankLoan); + 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 }; - 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,54 +961,57 @@ 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); 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 }; - arg = gGuestInitialCash; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &arg); + 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 }; - arg = (gGuestInitialHappiness * 100) / 255; - DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, &arg); + 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 }; - arg = ((255 - gGuestInitialHunger) * 100) / 255; - DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, &arg); + 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 }; - arg = ((255 - gGuestInitialThirst) * 100) / 255; - DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, &arg); + 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); } #pragma endregion @@ -1316,77 +1325,81 @@ 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; 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 }; - arg = gLandPrice; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &arg); + 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 }; - arg = gConstructionRightsPrice; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &arg); + 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 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) + 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 }; - arg = gParkEntranceFee; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &arg); + 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 }; - stringId = ClimateNames[static_cast(gClimate)]; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, &stringId); + 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); } #pragma endregion 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 16ee1e81b9..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[] = @@ -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); } /** @@ -560,23 +560,29 @@ 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) { - 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); } 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); } } @@ -621,17 +627,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 +648,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,13 +719,15 @@ 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; + 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); @@ -728,12 +736,12 @@ 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 - balance = abs(balance) >> yAxisScale; + balance = std::abs(balance) >> yAxisScale; while (balance > 127) { balance /= 2; @@ -743,12 +751,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 ft = Formatter(); - ft.Add(axisValue); + auto axisValue = axisBase << yAxisScale; + ft = Formatter(); + ft.Add(axisValue); DrawTextBasic( dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, { FontSpriteBase::SMALL, TextAlignment::RIGHT }); @@ -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 - money32 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); @@ -831,12 +840,12 @@ 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 - balance = abs(balance) >> yAxisScale; + balance = std::abs(balance) >> yAxisScale; while (balance > 255) { balance /= 2; @@ -846,12 +855,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 ft = Formatter(); - ft.Add(axisValue); + auto axisValue = axisBase << yAxisScale; + ft = Formatter(); + ft.Add(axisValue); DrawTextBasic( dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, { FontSpriteBase::SMALL, TextAlignment::RIGHT }); @@ -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 - money32 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); @@ -935,12 +945,12 @@ 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 - balance = abs(balance) >> yAxisScale; + balance = std::abs(balance) >> yAxisScale; while (balance > 127) { balance /= 2; @@ -950,12 +960,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; - auto ft = Formatter(); - ft.Add(axisValue); + money64 axisValue = axisBase << yAxisScale; + ft = Formatter(); + ft.Add(axisValue); DrawTextBasic( dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, { FontSpriteBase::SMALL, TextAlignment::RIGHT }); @@ -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 - money32 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 bd14160bb9..fec970f248 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -12,13 +12,18 @@ #include #include #include +#include #include #include #include #include #include #include +#include +#include +#include #include +#include #include #include #include @@ -30,11 +35,14 @@ 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; + +static PathConstructFlags FootpathCreateConstructFlags(ObjectEntryIndex& type); + // clang-format off enum { @@ -43,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, @@ -104,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); @@ -177,8 +179,8 @@ 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 bool footpath_select_default(); +static void footpath_get_next_path_info(ObjectEntryIndex* type, CoordsXYZ& footpathLoc, int32_t* slope); +static bool FootpathSelectDefault(); /** * @@ -186,21 +188,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 - PathSurfaceEntry* pathEntry = get_path_surface_entry(gFootpathSelectedId); - if (pathEntry != nullptr && (pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!FootpathSelectDefault()) { - pathEntry = nullptr; - } - - // Select the default path if we don't have one - if (pathEntry == 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 @@ -210,7 +201,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) @@ -343,53 +334,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++) - { - PathSurfaceEntry* pathType = get_path_surface_entry(i); - if (pathType == nullptr) - { - continue; - } - if ((pathType->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !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(); @@ -457,8 +436,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 type, slope; - if (_footpathConstructionMode != PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) { return; @@ -474,9 +451,15 @@ 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; + int32_t slope; footpath_get_next_path_info(&type, footpathLoc, &slope); - _window_footpath_cost = footpath_provisional_set(type, footpathLoc, slope); + auto pathConstructFlags = FootpathCreateConstructFlags(type); + + _window_footpath_cost = footpath_provisional_set(type, railings, footpathLoc, slope, pathConstructFlags); widget_invalidate(w, WIDX_CONSTRUCT); } @@ -489,7 +472,8 @@ 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); + int32_t slope; + footpath_get_next_path_info(nullptr, footpathLoc, &slope); gMapSelectArrowPosition = footpathLoc; gMapSelectArrowDirection = _footpathConstructDirection; if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_SHOW_ARROW) @@ -563,26 +547,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); - auto pathEntry = get_path_surface_entry(gFootpathSelectedId); - if (pathEntry != nullptr) + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) { - pathImage = pathEntry->preview; - // Editor-only paths might lack a queue image - queueImage = (pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) ? pathImage : pathImage + 1; + // 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,17 +617,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]; - int32_t selectedPath = gFootpathSelectedId + (MAX_PATH_OBJECTS * _footpathSelectedType); - PathSurfaceEntry* pathType = get_path_surface_entry(selectedPath); - image += pathType->image; + std::optional baseImage; + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) + { + auto selectedPath = gFootpathSelection.GetSelectedSurface(); + const auto* pathType = GetPathSurfaceEntry(selectedPath); + if (pathType != nullptr) + { + baseImage = pathType->BaseImageId; + } + } + else + { + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto* pathObj = static_cast( + objManager.GetLoadedObject(ObjectType::Paths, gFootpathSelection.LegacyPath)); + if (pathObj != nullptr) + { + auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); + if (gFootpathSelection.IsQueueSelected) + baseImage = pathEntry->GetQueueImage(); + else + baseImage = pathEntry->image; + } + } - // 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 @@ -633,7 +668,9 @@ 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 }); + auto ft = Formatter(); + ft.Add(_window_footpath_cost); + DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); } } } @@ -644,34 +681,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) { - int32_t i, image; - PathSurfaceEntry* pathType; + 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 (i = 0; i < MAX_PATH_OBJECTS; i++) + _dropdownEntries.clear(); + std::optional defaultIndex; + for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_SURFACE_OBJECTS; i++) { - pathType = get_path_surface_entry(i); + const auto* pathType = static_cast(objManager.GetLoadedObject(ObjectType::FootpathSurface, i)); if (pathType == nullptr) { continue; } - if ((pathType->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) + if ((pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) + { + continue; + } + 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] = 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; } - image = pathType->preview; - // 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)) + auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); + if ((pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) { - image++; + continue; + } + + if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL && gFootpathSelection.LegacyPath == i) + { + defaultIndex = numPathTypes; } gDropdownItemsFormat[numPathTypes] = STR_NONE; - gDropdownItemsArgs[numPathTypes] = image; + gDropdownItemsArgs[numPathTypes] = showQueues ? pathEntry->GetQueuePreviewImage() : pathEntry->GetPreviewImage(); + _dropdownEntries.push_back({ ObjectType::Paths, i }); numPathTypes++; } @@ -679,6 +745,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); } /** @@ -774,9 +842,11 @@ 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); + auto pathType = gFootpathSelection.GetSelectedSurface(); + auto constructFlags = FootpathCreateConstructFlags(pathType); + _window_footpath_cost = footpath_provisional_set( + pathType, gFootpathSelection.Railings, { info.Loc, z }, slope, constructFlags); window_invalidate_by_class(WC_FOOTPATH); } } @@ -795,7 +865,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; } @@ -869,11 +939,14 @@ 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 = FootpathCreateConstructFlags(selectedType); + + 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) { @@ -901,7 +974,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; } @@ -957,12 +1030,16 @@ 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 = FootpathCreateConstructFlags(type); + + 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) { @@ -1081,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()) { @@ -1198,15 +1275,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) { @@ -1219,33 +1297,152 @@ static void footpath_get_next_path_info(int32_t* type, CoordsXYZ& footpathLoc, i } } -static bool footpath_select_default() +static ObjectEntryIndex FootpathGetDefaultSurface(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++) { - PathSurfaceEntry* pathEntry = get_path_surface_entry(i); + auto pathEntry = GetPathSurfaceEntry(i); if (pathEntry != nullptr) { - footpathId = i; - - // Prioritise non-restricted path - if (!(pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR)) + if (!showEditorPaths && (pathEntry->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR)) { - break; + continue; + } + if (queue == ((pathEntry->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) + { + return i; } } } - if (footpathId == -1) + return OBJECT_ENTRY_INDEX_NULL; +} + +static ObjectEntryIndex FootpathGetDefaultRailings() +{ + 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 FootpathIsSurfaceEntryOkay(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 FootpathIsLegacyPathEntryOkay(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 FootpathGetDefaultLegacyPath() +{ + for (ObjectEntryIndex i = 0; i < MAX_PATH_OBJECTS; i++) + { + if (FootpathIsLegacyPathEntryOkay(i)) + { + return i; + } + } + return OBJECT_ENTRY_INDEX_NULL; +} + +static bool FootpathSelectDefault() +{ + // Select default footpath + auto surfaceIndex = FootpathGetDefaultSurface(false); + if (FootpathIsSurfaceEntryOkay(gFootpathSelection.NormalSurface, false)) + { + surfaceIndex = gFootpathSelection.NormalSurface; + } + + // Select default queue + auto queueIndex = FootpathGetDefaultSurface(true); + if (FootpathIsSurfaceEntryOkay(gFootpathSelection.QueueSurface, true)) + { + queueIndex = gFootpathSelection.QueueSurface; + } + + // Select default railing + auto railingIndex = FootpathGetDefaultRailings(); + const auto* railingEntry = GetPathRailingsEntry(gFootpathSelection.Railings); + if (railingEntry != nullptr) + { + railingIndex = gFootpathSelection.Railings; + } + + // Select default legacy path + auto legacyPathIndex = FootpathGetDefaultLegacyPath(); + if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) + { + if (FootpathIsLegacyPathEntryOkay(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; + } + + // No surfaces available, so default to legacy path + gFootpathSelection.LegacyPath = legacyPathIndex; + } + + gFootpathSelection.NormalSurface = surfaceIndex; + gFootpathSelection.QueueSurface = queueIndex; + gFootpathSelection.Railings = railingIndex; + 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() @@ -1343,7 +1540,7 @@ void window_footpath_keyboard_shortcut_build_current() window_event_mouse_up_call(w, WIDX_CONSTRUCT); } -void window_footpath_reset_selected_path() +void WindowFootpathResetSelectedPath() { - _footpathSelectedType = 0; + gFootpathSelection = {}; } diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 4f65f9a81b..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 @@ -62,7 +63,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; @@ -174,12 +175,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: @@ -198,8 +199,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); @@ -315,7 +316,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())) @@ -350,26 +351,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); @@ -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..03152134e0 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 @@ -20,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -35,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, @@ -46,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, @@ -74,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 @@ -94,50 +97,53 @@ 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, }; +// clang-format on 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 }, + MakeWidget({ 3, 57 }, { 186, 87 }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), + 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 -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); @@ -145,47 +151,52 @@ 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_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_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; + 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; @@ -197,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; @@ -206,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; @@ -219,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; @@ -228,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; @@ -237,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; @@ -246,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; @@ -256,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(); @@ -336,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); @@ -391,7 +397,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; @@ -403,8 +408,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; @@ -585,13 +588,13 @@ 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) 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); } @@ -602,12 +605,10 @@ 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: - w->ScrollToViewport(); - break; case WIDX_TRACK: { uint32_t flags = peep->PeepFlags ^ PEEP_FLAGS_TRACKING; @@ -619,6 +620,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 @@ -631,7 +677,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; @@ -656,7 +702,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; } @@ -680,16 +726,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->focus.has_value()) return; origViewportFlags = w->viewport->flags; @@ -700,22 +742,14 @@ 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]; - 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, 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->focus.value()); if (w->viewport != nullptr && reCreateViewport) { w->viewport->flags = origViewportFlags; @@ -736,10 +770,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++; @@ -808,8 +842,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) @@ -846,8 +880,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; @@ -868,8 +902,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; @@ -890,8 +924,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; @@ -912,8 +946,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); } @@ -923,8 +957,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) @@ -951,7 +985,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; @@ -968,22 +1002,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)) { @@ -1009,7 +1043,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); @@ -1099,7 +1133,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); } } } @@ -1131,7 +1165,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; @@ -1179,7 +1213,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{ @@ -1376,7 +1410,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); @@ -1446,7 +1480,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(); @@ -1455,7 +1489,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] = EnumValue(ride.id); curr_list_position++; } } @@ -1602,11 +1636,12 @@ 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; } - 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(); @@ -1657,7 +1692,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 +1700,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 +1712,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 +1734,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 +1750,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 +1765,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/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 3923ec3a47..d26fc6ac55 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -16,9 +16,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -60,7 +62,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 @@ -182,7 +184,7 @@ public: { case GuestListFilterType::GuestsOnRide: { - auto guestRide = get_ride(index); + auto guestRide = get_ride(static_cast(index)); if (guestRide != nullptr) { ft.Add( @@ -198,7 +200,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 +215,7 @@ public: } case GuestListFilterType::GuestsThinkingAboutRide: { - auto guestRide = get_ride(index); + auto guestRide = get_ride(static_cast(index)); if (guestRide != nullptr) { ft.Add(STR_NONE); @@ -301,7 +303,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; @@ -321,8 +323,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 +583,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(); } @@ -668,7 +676,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; } @@ -738,7 +746,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; } @@ -807,7 +815,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 +842,7 @@ private: void RefreshGroups() { - _lastFindGroupsTick = floor2(gScenarioTicks, 256); + _lastFindGroupsTick = floor2(gCurrentTicks, 256); _lastFindGroupsSelectedView = _selectedView; _lastFindGroupsWait = 320; _groups.clear(); diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 924e129b88..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); @@ -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); @@ -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); } } @@ -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 609e3fdfb7..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 @@ -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: @@ -81,8 +82,8 @@ public: gLandPaintMode = false; _selectedFloorTexture = 0; _selectedWallTexture = 0; - gLandToolRaiseCost = MONEY32_UNDEFINED; - gLandToolLowerCost = MONEY32_UNDEFINED; + gLandToolRaiseCost = MONEY64_UNDEFINED; + gLandToolLowerCost = MONEY64_UNDEFINED; } void OnClose() override @@ -256,7 +257,7 @@ public: { ScreenCoordsXY screenCoords; int32_t numTiles; - money32 price; + money64 price; rct_widget* previewWidget = &widgets[WIDX_PREVIEW]; DrawWidgets(dpi); @@ -264,10 +265,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) { @@ -283,13 +284,21 @@ public: if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) { // Draw raise cost amount - if (gLandToolRaiseCost != MONEY32_UNDEFINED && gLandToolRaiseCost != 0) - DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, &gLandToolRaiseCost, { TextAlignment::CENTRE }); + if (gLandToolRaiseCost != MONEY64_UNDEFINED && gLandToolRaiseCost != 0) + { + auto ft = Formatter(); + ft.Add(gLandToolRaiseCost); + DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + } screenCoords.y += 10; // Draw lower cost amount - if (gLandToolLowerCost != MONEY32_UNDEFINED && gLandToolLowerCost != 0) - DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, &gLandToolLowerCost, { TextAlignment::CENTRE }); + if (gLandToolLowerCost != MONEY64_UNDEFINED && gLandToolLowerCost != 0) + { + auto ft = Formatter(); + ft.Add(gLandToolLowerCost); + DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + } screenCoords.y += 50; // Draw paint price @@ -302,18 +311,18 @@ 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); - DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft.Data(), { TextAlignment::CENTRE }); + ft.Add(price); + 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..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); @@ -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) @@ -262,16 +263,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 }); } } @@ -282,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/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 74585956a9..88a50c50d3 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 @@ -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: @@ -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 }); } @@ -755,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) @@ -1057,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; @@ -1071,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; @@ -1138,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 a31f96226b..564cf4f21c 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); @@ -41,13 +41,13 @@ 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); + 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; gShowLandRightsRefCount = 0; gShowConstuctionRightsRefCount = 0; - window_footpath_reset_selected_path(); + WindowFootpathResetSelectedPath(); return window; } @@ -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-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index b081489442..07036740e2 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -18,12 +18,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -65,13 +67,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, @@ -98,6 +101,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 ), @@ -117,7 +121,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 @@ -126,39 +130,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; @@ -176,7 +180,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; @@ -655,17 +658,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; @@ -822,9 +816,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 +847,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) { @@ -985,16 +979,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) @@ -1185,7 +1181,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; @@ -1214,13 +1210,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; } @@ -1255,7 +1251,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; @@ -1296,7 +1292,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(); @@ -1327,7 +1323,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); @@ -1349,7 +1345,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(); @@ -1368,20 +1364,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++; - 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(); - gfx_invalidate_screen(); + auto increaseMapSizeAction = ChangeMapSizeAction(gMapSize + 1); + GameActions::Execute(&increaseMapSizeAction); } /** @@ -1390,20 +1374,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--; - 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(); - 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-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 9a63298231..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, @@ -45,7 +46,6 @@ enum { WIDX_TAB_3, WIDX_TAB_4, - TAB_BEGIN, WIDX_MAP_GENERATE = TAB_BEGIN, @@ -114,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 */ \ @@ -130,7 +131,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[] = { @@ -138,7 +139,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[] = { @@ -155,7 +156,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[] = { @@ -168,51 +169,51 @@ 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, }; +// 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; @@ -223,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; @@ -233,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; @@ -245,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; @@ -254,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) | @@ -394,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 @@ -494,7 +503,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 +517,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; } } @@ -686,8 +696,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 +713,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 @@ -806,17 +818,20 @@ 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; 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; @@ -877,11 +892,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: @@ -1003,8 +1018,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 +1041,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 +1073,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 @@ -1101,11 +1125,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; } @@ -1216,45 +1240,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/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 9b5a9f1de2..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 @@ -130,7 +130,7 @@ rct_window* window_maze_construction_open() WindowInitScrollWidgets(w); - w->number = _currentRideIndex; + w->rideId = _currentRideIndex; window_push_others_right(w); show_gridlines(); @@ -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; @@ -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, EnumValue(ride->id)); context_open_intent(&intent); } } @@ -181,17 +181,17 @@ 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); 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::MazeBuild); 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,34 +300,38 @@ 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(); + UpdateGhostTrackAndArrow(); } /** @@ -362,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) @@ -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::MazeBuild: 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::MazeBuild: 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/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 95bf461411..319b78b949 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,14 +100,14 @@ 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[] = { 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); @@ -415,37 +425,45 @@ 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; } 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 +576,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) @@ -583,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]; } @@ -690,7 +711,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; } } @@ -885,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/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/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 5866110b8a..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]; @@ -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/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 00940518e9..bcfe8e0f53 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 { @@ -47,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 @@ -205,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 @@ -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; } @@ -346,20 +349,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 - money32 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 - money32 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/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 3dbde5e4c3..52edabd054 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; @@ -149,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 @@ -162,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 @@ -202,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 @@ -245,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); @@ -598,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) { @@ -819,8 +826,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); @@ -941,9 +948,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; - money32 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice; - price *= TrackPricing[unk2]; + int32_t startPieceId = GetRideTypeDescriptor(item.Type).StartTrackPiece; + money64 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice; + const auto& ted = GetTrackElementDescriptor(startPieceId); + price *= ted.Price; price = (price >> 17) * 10 * GetRideTypeDescriptor(item.Type).BuildCosts.PriceEstimateMultiplier; // @@ -952,7 +960,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/News.cpp b/src/openrct2-ui/windows/News.cpp index 2fa7db71f9..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 @@ -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()); } } } @@ -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/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index 5c0cc4c564..00c4004166 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); @@ -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; @@ -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) { @@ -266,9 +274,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/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index ed1b1e70a0..ecce57249d 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() }); @@ -280,339 +282,296 @@ 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(const rct_object_entry *entry); -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(const rct_object_entry* entry) +static constexpr rct_string_id GetStringFromObjectType(const ObjectType type) { - rct_string_id result; - switch (entry->GetType()) + 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 { - // 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); +private: + std::vector _invalidEntries; + int32_t _highlightedIndex = -1; + std::string _filePath; +#ifndef DISABLE_HTTP + ObjectDownloader _objDownloader; + bool _updatedListAfterDownload{}; - // 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; - for (uint16_t i = 0; i < w->no_list_items; i++) + void DownloadAllObjects() { - cur_len += (8 + line_sep_len); - assert(cur_len < buffer_len); - - uint16_t nameLength = 8; - for (; nameLength > 0; nameLength--) + if (!_objDownloader.IsDownloading()) { - if (_invalid_entries[i].name[nameLength - 1] != ' ') - break; + _updatedListAfterDownload = false; + _objDownloader.Begin(_invalidEntries); + } + } + + void UpdateObjectList() + { + const auto entries = _objDownloader.GetDownloadedEntries(); + for (auto& de : entries) + { + _invalidEntries.erase( + std::remove_if( + _invalidEntries.begin(), _invalidEntries.end(), + [de](const ObjectEntryDescriptor& e) { return de.GetName() == e.GetName(); }), + _invalidEntries.end()); + } + no_list_items = static_cast(_invalidEntries.size()); + } +#endif + + /** + * Returns a newline-separated string listing all object names. + * Used for placing all names on the clipboard. + */ + void CopyObjectNamesToClipboard() + { + std::stringstream stream; + for (uint16_t i = 0; i < no_list_items; i++) + { + const auto& entry = _invalidEntries[i]; + stream << entry.GetName(); + stream << PLATFORM_NEWLINE; } - strncat(buffer, _invalid_entries[i].name, nameLength); - strncat(buffer, PLATFORM_NEWLINE, buffer_len - strlen(buffer) - 1); + const auto clip = stream.str(); + OpenRCT2::GetContext()->GetUiContext()->SetClipboardText(clip.c_str()); } - platform_place_string_on_clipboard(buffer); - delete[] buffer; -} - -rct_window* window_object_load_error_open(utf8* path, size_t numMissingObjects, const rct_object_entry* 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); - if (window == nullptr) + void SelectObjectFromList(const int32_t index) { - window = WindowCreateCentred(WW, WH, &window_object_load_error_events, WC_OBJECT_LOAD_ERROR, 0); + if (index < 0 || index > no_list_items) + { + selected_list_item = -1; + } + else + { + selected_list_item = index; + } + widget_invalidate(this, WIDX_SCROLL); + } - window->widgets = window_object_load_error_widgets; - window->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_COPY_CURRENT) | (1ULL << WIDX_COPY_ALL) +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(window); - window->colours[0] = COLOUR_LIGHT_BLUE; - window->colours[1] = COLOUR_LIGHT_BLUE; - window->colours[2] = COLOUR_LIGHT_BLUE; + WindowInitScrollWidgets(this); + colours[0] = COLOUR_LIGHT_BLUE; + colours[1] = COLOUR_LIGHT_BLUE; + colours[2] = COLOUR_LIGHT_BLUE; } - // Refresh list items and path - window->no_list_items = static_cast(numMissingObjects); - file_path = path; - - 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)) + void OnClose() override { - highlighted_index = -1; - widget_invalidate(w, WIDX_SCROLL); + _invalidEntries.clear(); + _invalidEntries.shrink_to_fit(); } -#ifndef DISABLE_HTTP - _objDownloader.Update(); - - // Remove downloaded objects from our invalid entry list - if (_objDownloader.IsDownloading()) + void OnMouseUp(const rct_widgetindex widgetIndex) override { - // Don't do this too often as it isn't particularly efficient - if (w->frame_no % 64 == 0) + switch (widgetIndex) { - window_object_load_error_update_list(w); + 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 } } - 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) + void OnUpdate() override { - 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) + 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) { - utf8* selected_name = strndup(_invalid_entries[w->selected_list_item].name, 8); - utf8* strp = strchr(selected_name, ' '); - if (strp != nullptr) - *strp = '\0'; - - platform_place_string_on_clipboard(selected_name); - SafeFree(selected_name); + UpdateObjectList(); } - 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; + } + else if (!_updatedListAfterDownload) + { + UpdateObjectList(); + _updatedListAfterDownload = true; + } #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) + ScreenSize OnScrollGetSize(const int32_t scrollIndex) override { - w->selected_list_item = -1; + return ScreenSize(0, no_list_items * SCROLLABLE_ROW_HEIGHT); } - else + + void OnScrollMouseDown(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { - w->selected_list_item = index; + const auto selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + SelectObjectFromList(selectedItem); } - 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++) + void OnScrollMouseOver(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { - ScreenCoordsXY screenCoords; - screenCoords.y = i * SCROLLABLE_ROW_HEIGHT; - if (screenCoords.y > dpi->y + dpi->height) - break; + // 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; - 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; - gfx_draw_string(dpi, screenCoords, strndup(_invalid_entries[i].name, 8), { COLOUR_DARK_GREEN }); - - // ... 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 }); - - // ... and type - rct_string_id type = get_object_type_string(&_invalid_entries[i]); - DrawTextBasic(dpi, { TYPE_COL_LEFT - 3, screenCoords.y }, type, {}, { COLOUR_DARK_GREEN }); + widget_invalidate(this, WIDX_SCROLL); } -} -#ifndef DISABLE_HTTP - -static void window_object_load_error_download_all(rct_window* w) -{ - if (!_objDownloader.IsDownloading()) + void OnDraw(rct_drawpixelinfo& dpi) override { - _updatedListAfterDownload = false; - _objDownloader.Begin(_invalid_entries); - } -} + WindowDrawWidgets(this, &dpi); -static void window_object_load_error_update_list(rct_window* w) -{ - auto entries = _objDownloader.GetDownloadedEntries(); - for (auto& de : entries) + // 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 { - _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; }), - _invalid_entries.end()); - w->no_list_items = static_cast(_invalid_entries.size()); - } -} + 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(); -#endif + 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) +{ + // Check if window is already open + auto* window = window_bring_to_front_by_class(WC_OBJECT_LOAD_ERROR); + if (window == nullptr) + { + window = WindowCreate(WC_OBJECT_LOAD_ERROR, WW, WH, 0); + } + + static_cast(window)->Initialise(path, numMissingObjects, missingObjects); + + return window; +} diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 55f9347c39..2cb0a64b97 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[] = { @@ -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[] = { @@ -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,1819 +542,1911 @@ 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, { 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, w, { colour }); - - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_SCALE].top + 1 }, STR_UI_SCALING_DESC, w, - { 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] }); - - int32_t scale = 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] }); - - 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, w, { 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) -{ - widget = &w->widgets[widgetIndex - 1]; - - 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."); - dropdownIndex = fallbackLanguage - 1; - } - 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, { w->colours[1] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_CURRENCY].top + 1 }, STR_CURRENCY, w, - { 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] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_TEMPERATURE].top + 1 }, STR_TEMPERATURE, w, - { 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] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_DATE_FORMAT].top + 1 }, STR_DATE_FORMAT, w, - { 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); + + 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)]; + + 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(rct_widget* widget, 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) - { - rct_widget* widget; - - widget = &window_options_audio_widgets[WIDX_MASTER_VOLUME]; - uint8_t master_volume = get_scroll_percentage(widget, &w->scrolls[0]); - if (master_volume != gConfigSound.master_volume) - { - gConfigSound.master_volume = master_volume; - config_save_default(); - 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]); - if (sound_volume != gConfigSound.sound_volume) - { - gConfigSound.sound_volume = sound_volume; - config_save_default(); - 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]); - 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) -{ - rct_widget* widget = &window_options_audio_widgets[widget_index]; - rct_scroll* scroll = &w->scrolls[scroll_id]; - - int 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, { 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, { 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] }); -} - -#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) - { - // 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, { 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, { w->colours[1] }); - int32_t autosavesToKeep = 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] }); - - auto 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); + } } - else + } + + void AdvancedDropdown(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(); + this->Invalidate(); + } + break; + } + } + + void AdvancedPrepareDraw() + { + this->CommonPrepareDrawBefore(); + + 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); + + this->CommonPrepareDrawAfter(); + } + + void AdvancedDraw(rct_drawpixelinfo* dpi) + { + WindowDrawWidgets(this, dpi); + this->DrawTabImages(dpi); + + 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] }); + + ft = Formatter(); + ft.Add(Platform::StrDecompToPrecomp(gConfigGeneral.rct1_path)); + + 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, {} }; } - return { fallback, {} }; -} -#pragma region Event lists +#pragma endregion -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; -}); + 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]; -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; -}); + this->Invalidate(); + window_event_resize_call(this); + window_event_invalidate_call(this); + WindowInitScrollWidgets(this); + this->Invalidate(); + } -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; -}); + 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); + } -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; -}); + 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); + } -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 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); + } -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; -}); + void DrawTabImage(rct_drawpixelinfo* dpi, int32_t p, int32_t spriteIndex) + { + rct_widgetindex widgetIndex = WIDX_TAB_1 + p; + rct_widget* widget = &this->widgets[widgetIndex]; -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; -}); + auto screenCoords = this->windowPos + ScreenCoordsXY{ widget->left, widget->top }; -// 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, + 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 diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index d8af2509a8..c08e4a223b 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[] = { @@ -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 @@ -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; @@ -516,7 +513,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: @@ -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 = Focus(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->focus = 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)) @@ -898,7 +882,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 +898,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, @@ -945,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)) @@ -1033,8 +1017,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 +1033,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, @@ -1062,7 +1047,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 @@ -1181,12 +1179,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); - 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] }); + ft = Formatter(); + ft.Add(parkEntranceFee); + DrawTextBasic(dpi, screenCoords, stringId, ft, { w->colours[1] }); } #pragma endregion @@ -1336,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)) @@ -1382,7 +1382,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; } } @@ -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); } } @@ -1529,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 640d1a73f4..a9b95b172b 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 { @@ -62,17 +63,17 @@ 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[] = { window_player_overview_widgets, - window_player_statistics_widgets + window_player_statistics_widgets, }; #pragma endregion @@ -119,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 @@ -140,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 @@ -154,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; @@ -163,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; @@ -265,8 +264,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 +274,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); - playerSetGroupAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + 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([windowHandle](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); @@ -546,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 = 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); window_player_update_viewport(w, false); @@ -607,7 +608,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; } @@ -617,13 +618,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/Research.cpp b/src/openrct2-ui/windows/Research.cpp index b3fea5afaf..7c7aec69ce 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,12 +87,12 @@ 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[] = { 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); @@ -288,69 +291,72 @@ 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) { - { - 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 = { STR_RESEARCH_UNKNOWN, 0 }; + 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; } } - DrawTextWrapped(dpi, screenCoords, 296, label, &strings); + else + { + ft.Add(gResearchNextItem->GetName()); + } + 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 @@ -371,31 +377,33 @@ 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 }; - 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; } } - DrawTextWrapped(dpi, screenCoords, 266, lastDevelopmentFormat, &strings); + DrawTextWrapped(dpi, screenCoords, 266, lastDevelopmentFormat, ft); } } @@ -561,8 +569,9 @@ void window_research_funding_page_paint(rct_window* w, rct_drawpixelinfo* dpi, r return; int32_t currentResearchLevel = gResearchFundingLevel; - money32 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 3403f0b486..a293dc3fbc 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -55,14 +55,18 @@ #include #include #include +#include #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; static constexpr const int32_t WW = 316; +static void populate_vehicle_type_dropdown(Ride* ride, bool forceRefresh = false); + enum { WINDOW_RIDE_PAGE_MAIN, @@ -244,7 +248,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 @@ -255,7 +259,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 @@ -278,7 +282,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 @@ -289,7 +293,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 @@ -315,7 +319,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 @@ -324,7 +328,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 @@ -335,7 +339,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 @@ -346,7 +350,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 @@ -358,7 +362,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 @@ -367,7 +371,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[] = { @@ -380,7 +384,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 \ @@ -517,114 +521,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_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; @@ -637,8 +644,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; @@ -651,8 +657,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; @@ -663,8 +668,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; @@ -675,8 +679,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; @@ -691,8 +694,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; @@ -703,8 +705,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; @@ -719,8 +720,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; @@ -734,8 +734,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; @@ -746,8 +745,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; @@ -755,6 +753,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, @@ -765,8 +764,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 @@ -777,16 +777,22 @@ 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; +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, @@ -804,7 +810,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] = { @@ -871,19 +877,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 { @@ -941,9 +948,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 }); } } @@ -956,7 +962,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(w->rideId); if (ride != nullptr) { int32_t spriteIndex = 0; @@ -978,9 +984,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 }); } } } @@ -992,13 +998,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; @@ -1010,9 +1016,9 @@ 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->number); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -1067,7 +1073,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; @@ -1077,7 +1083,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 }); } } @@ -1106,7 +1112,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(w->rideId); if (ride == nullptr) return; @@ -1164,10 +1170,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)) { @@ -1181,31 +1187,28 @@ 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); } - if (ride->id >= ride_overall_views.size()) + const auto rideIndex = EnumValue(ride->id); + if (rideIndex >= ride_overall_views.size()) { - ride_overall_views.resize(ride->id + 1); + ride_overall_views.resize(rideIndex + 1); } - auto& view = ride_overall_views[ride->id]; - view.x = (minx + maxx) / 2 + 16; - view.y = (miny + maxy) / 2 + 16; - view.z = (minz + maxz) / 2 - 8; + auto& view = ride_overall_views[rideIndex]; + view.loc = CoordsXYZ{ (min.x + max.x) / 2, (min.y + max.y) / 2, (min.z + max.z) / 2 } + CoordsXYZ{ 16, 16, -8 }; // Calculate size to determine from how far away to view the ride - 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) { @@ -1232,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 = ride->id; + w->rideId = ride->id; w->page = WINDOW_RIDE_PAGE_MAIN; w->vehicleIndex = 0; @@ -1248,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; } @@ -1262,7 +1267,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, EnumValue(ride->id)); if (w == nullptr) { w = window_ride_open(ride); @@ -1303,7 +1308,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, EnumValue(ride->id)); if (w == nullptr) { w = window_ride_open(ride); @@ -1332,7 +1337,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--; } @@ -1367,7 +1372,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& ted = GetTrackElementDescriptor(trackType); + if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { auto stationIndex = trackElement->GetStationIndex(); return window_ride_open_station(ride, stationIndex); @@ -1404,7 +1410,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, EnumValue(ride->id)); if (w != nullptr) { w->Invalidate(); @@ -1439,7 +1445,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, EnumValue(ride->id)) + : window_bring_to_front_by_number(WC_RIDE, EnumValue(ride->id)); } if (w == nullptr) @@ -1483,7 +1490,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, @@ -1546,6 +1553,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(static_cast(w.number)); + if (ride == nullptr) + return std::nullopt; + + int32_t viewSelectionIndex = w.ride.view - 1 - ride->num_vehicles; + if (viewSelectionIndex < 0) + { + return std::nullopt; + } + + for (StationIndex index = 0; index < std::size(ride->stations); ++index) + { + const auto& station = ride->stations[index]; + if (!station.Start.IsNull()) + { + if (viewSelectionIndex-- == 0) + { + return { index }; + } + } + } + return std::nullopt; +} + /** * * rct2: 0x006AF994 @@ -1555,97 +1588,61 @@ 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(w->rideId); if (ride == nullptr) return; - int32_t eax = w->viewport_focus_coordinates.var_480 - 1; + int32_t viewSelectionIndex = w->ride.view - 1; - union + std::optional focus; + + if (viewSelectionIndex >= 0 && viewSelectionIndex < ride->num_vehicles && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) { - 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; - - if (eax >= 0 && eax < ride->num_vehicles && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) - { - focus.sprite.sprite_id = ride->vehicles[eax]; - + 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(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 = Focus(vehId); } } - 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; - int32_t count = eax - ride->num_vehicles; - do + auto stationIndex = GetStationIndexFromViewSelection(*w); + if (stationIndex) { - stationIndex++; - if (!ride->stations[stationIndex].Start.isNull()) - { - count--; - } - } while (count >= 0); - - 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 = Focus(location); + } } else { - if (eax > 0) + 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; + focus = Focus(view.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->focus) { return; } @@ -1659,31 +1656,23 @@ 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->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]; + 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; - 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); + 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()); w->flags |= WF_NO_SCROLLING; w->Invalidate(); } - if (w->viewport) + if (w->viewport != nullptr) { w->viewport->flags = viewport_flags; w->Invalidate(); @@ -1696,12 +1685,12 @@ 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(w->rideId); if (ride != nullptr) { 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); } } @@ -1730,11 +1719,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(w->rideId); 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, EnumValue(ride->id)) != nullptr) { window_close(w); } @@ -1744,9 +1733,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; @@ -1755,7 +1741,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(w->rideId); if (ride != nullptr) { RideStatus status; @@ -1793,7 +1779,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(w->rideId); if (ride != nullptr) { #ifdef __SIMULATE_IN_RIDE_WINDOW__ @@ -1815,6 +1801,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); } @@ -1825,7 +1813,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(w->rideId); if (ride == nullptr) return; @@ -1891,14 +1879,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: @@ -1941,7 +1926,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(w->rideId); if (info.Ride == nullptr) return; @@ -2009,7 +1994,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(w->rideId); if (ride == nullptr) return; @@ -2042,7 +2027,50 @@ static void window_ride_show_ride_type_dropdown(rct_window* w, rct_widget* widge Dropdown::SetChecked(pos, true); } -static void populate_vehicle_type_dropdown(Ride* ride) +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, bool forceRefresh) { auto& objManager = GetContext()->GetObjectManager(); rct_ride_entry* rideEntry = ride->GetRideEntry(); @@ -2067,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; @@ -2105,7 +2133,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(w->rideId); if (ride == nullptr) return; @@ -2157,6 +2185,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; } } @@ -2172,7 +2203,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(w->rideId); if (ride != nullptr) { if (dropdownIndex != 0 && dropdownIndex <= ride->num_vehicles @@ -2193,7 +2224,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(w->rideId); if (ride != nullptr) { auto status = RideStatus::Closed; @@ -2230,7 +2261,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) { - auto rideSetSetting = RideSetSettingAction(w->number, 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. @@ -2241,6 +2272,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; + } } } @@ -2256,7 +2300,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(w->rideId); if (ride != nullptr) { if (!(ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAIN)) @@ -2291,7 +2335,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(w->rideId); if (ride != nullptr) { ride_set_name(ride, text, 0); @@ -2325,7 +2369,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(w->rideId); if (ride == nullptr) return; @@ -2457,7 +2501,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(w->rideId); if (ride != nullptr) { ride->FormatStatusTo(ft); @@ -2476,7 +2520,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(w->rideId); if (ride == nullptr) return STR_EMPTY; @@ -2524,40 +2568,35 @@ 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(w->rideId); 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) @@ -2580,7 +2619,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(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) @@ -2610,7 +2649,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(w->rideId); if (ride == nullptr) return; @@ -2636,7 +2675,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(); @@ -2692,7 +2731,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(w->rideId); if (ride == nullptr) return; @@ -2735,7 +2774,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(w->rideId); if (ride != nullptr) { auto newRideType = VehicleDropdownData[dropdownIndex].subtype_id; @@ -2760,7 +2799,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(w->rideId); if (ride == nullptr) return { STR_NONE, {} }; @@ -2827,7 +2866,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(w->rideId); if (ride == nullptr) return; @@ -2907,7 +2946,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(w->rideId); if (ride == nullptr) return; @@ -2918,24 +2957,28 @@ 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 - DrawTextBasic(dpi, screenCoords, STR_CAPACITY, &rideEntry->capacity, COLOUR_BLACK); + 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->excitement_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) @@ -2943,18 +2986,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); } } @@ -2974,7 +3021,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(w->rideId); if (ride == nullptr) return; @@ -3067,7 +3114,7 @@ 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); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3083,7 +3130,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)); + w->rideId, RideSetSetting::Operation, std::clamp(ride->operation_option + increment, minValue, maxValue)); } /** @@ -3092,7 +3139,7 @@ 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); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3107,7 +3154,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)); + w->rideId, RideSetSetting::Operation, std::clamp(ride->operation_option - decrement, minValue, maxValue)); } /** @@ -3119,7 +3166,7 @@ static void window_ride_mode_dropdown(rct_window* w, rct_widget* widget) rct_widget* dropdownWidget; dropdownWidget = widget - 1; - auto ride = get_ride(w->number); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3158,7 +3205,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) { - auto ride = get_ride(w->number); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3181,7 +3228,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 = w->rideId; + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3203,23 +3251,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; } } @@ -3239,7 +3285,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 = w->rideId; + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3256,42 +3303,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: @@ -3304,13 +3351,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; } } @@ -3324,7 +3371,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 = w->rideId; + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3348,12 +3396,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; } } @@ -3368,7 +3416,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(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_OPERATING) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_OPERATING; @@ -3394,7 +3442,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(w->rideId); if (ride == nullptr) return; @@ -3635,7 +3683,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(w->rideId); if (ride == nullptr) return; @@ -3649,10 +3697,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); } } @@ -3666,7 +3715,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(w->rideId); if (ride == nullptr) return; @@ -3756,7 +3805,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(w->rideId); if (ride == nullptr) return; @@ -3860,7 +3909,7 @@ static void window_ride_maintenance_dropdown(rct_window* w, rct_widgetindex widg if (dropdownIndex == -1) return; - auto ride = get_ride(w->number); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3871,7 +3920,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(w->rideId, RideSetSetting::InspectionInterval, dropdownIndex); break; case WIDX_FORCE_BREAKDOWN: @@ -3966,7 +4015,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(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAINTENANCE) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MAINTENANCE; @@ -3989,7 +4038,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(w->rideId); if (ride == nullptr) return; @@ -4031,7 +4080,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(w->rideId); if (ride == nullptr) return; @@ -4051,29 +4100,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 @@ -4081,8 +4133,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 @@ -4127,7 +4180,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 }); } @@ -4182,7 +4235,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() != w->rideId) return; if (info.Element->AsTrack()->GetColourScheme() == newColourScheme) return; @@ -4260,7 +4313,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(w->rideId); if (ride == nullptr) return; @@ -4393,6 +4446,7 @@ static void window_ride_colour_dropdown(rct_window* w, rct_widgetindex widgetInd if (dropdownIndex == -1) return; + const auto rideId = w->rideId; switch (widgetIndex) { case WIDX_TRACK_COLOUR_SCHEME_DROPDOWN: @@ -4402,28 +4456,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; @@ -4439,7 +4493,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; } @@ -4451,7 +4505,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; } @@ -4463,21 +4517,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; @@ -4534,7 +4588,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(w->rideId); if (ride == nullptr) return; @@ -4758,9 +4812,8 @@ 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->number); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -4768,12 +4821,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); @@ -4782,7 +4835,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) @@ -4809,7 +4862,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); @@ -4817,12 +4871,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); @@ -4860,7 +4915,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(w->rideId); if (ride == nullptr) return; @@ -4902,17 +4957,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; @@ -4923,11 +4978,11 @@ static std::vector window_ride_current_music_style_order; */ static void window_ride_toggle_music(rct_window* w) { - auto ride = get_ride(w->number); + auto ride = get_ride(w->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(w->rideId, RideSetSetting::Music, activateMusic); } } @@ -4977,9 +5032,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); @@ -4999,7 +5054,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(w->rideId); if (ride == nullptr) return; @@ -5014,7 +5069,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) @@ -5078,7 +5134,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(w->rideId, RideSetSetting::MusicType, musicStyle); } } @@ -5108,7 +5164,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(w->rideId); if (ride == nullptr) return; @@ -5175,8 +5231,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); } @@ -5199,7 +5254,7 @@ static void setup_scenery_selection(rct_window* w) while (tool_set(w, WIDX_BACKGROUND, Tool::Crosshair)) ; - gTrackDesignSaveRideIndex = w->number; + gTrackDesignSaveRideIndex = w->rideId; track_design_save_init(); gGamePaused |= GAME_PAUSED_SAVING_TRACK; @@ -5208,8 +5263,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); } @@ -5262,7 +5316,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(w->rideId); _trackDesign = ride->SaveToTrackDesign(); if (!_trackDesign) { @@ -5354,7 +5408,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(w->rideId); if (ride == nullptr) return; @@ -5480,7 +5534,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 = w->rideId; + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -5489,7 +5544,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; @@ -5525,9 +5580,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); @@ -5545,7 +5597,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi } else { - auto ride = get_ride(w->number); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -5599,20 +5651,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 @@ -5620,7 +5675,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); @@ -5657,7 +5712,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; @@ -5693,51 +5748,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; } } @@ -5857,7 +5921,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(w->rideId); if (ride != nullptr) { RideMeasurement* measurement{}; @@ -5882,7 +5946,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(w->rideId); if (ride != nullptr) { RideMeasurement* measurement{}; @@ -5911,7 +5975,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(w->rideId); if (ride != nullptr) { auto [measurement, message] = ride->GetMeasurement(); @@ -5923,10 +5987,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 @@ -5951,7 +6013,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(w->rideId); if (ride == nullptr) return; @@ -6017,7 +6079,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(w->rideId); if (ride == nullptr) { return; @@ -6078,15 +6140,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; } @@ -6205,7 +6272,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 = w->rideId; + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -6231,7 +6299,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); } @@ -6241,7 +6309,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 = w->rideId; + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -6255,13 +6324,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(w->rideId, price, true); GameActions::Execute(&rideSetPriceAction); } @@ -6274,7 +6343,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(w->rideId); if (ride == nullptr) return; @@ -6294,7 +6363,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(w->rideId); if (ride == nullptr) return; @@ -6307,7 +6376,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(w->rideId); if (ride == nullptr) return 0; @@ -6317,13 +6386,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(w->rideId, 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(w->rideId); if (ride == nullptr) return false; @@ -6388,12 +6457,13 @@ 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(w->rideId); if (ride != nullptr) { 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; } @@ -6406,7 +6476,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: @@ -6457,7 +6527,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(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_INCOME) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_INCOME; @@ -6504,14 +6574,14 @@ 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(w->rideId); 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(); @@ -6537,11 +6607,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; @@ -6592,7 +6661,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; } @@ -6608,13 +6679,13 @@ 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; ShopItem primaryItem, secondaryItem; WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(w->number); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -6640,7 +6711,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 +6735,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 != MONEY32_UNDEFINED) + 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 != MONEY32_UNDEFINED) + 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 @@ -6767,7 +6853,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(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_CUSTOMER) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_CUSTOMER; @@ -6790,7 +6876,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(w->rideId); if (ride != nullptr) { auto ft = Formatter::Common(); @@ -6821,13 +6907,12 @@ 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); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(w->number); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -6838,14 +6923,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 +6946,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 +6962,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 @@ -6881,7 +6972,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; } @@ -6889,7 +6982,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 +6994,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 +7002,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 +7022,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 6b045d31ab..9cf486e4a3 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 @@ -42,10 +43,12 @@ 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 -enum { +enum +{ WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, @@ -93,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 ), @@ -130,28 +134,28 @@ 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, }; +// 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; @@ -170,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 @@ -464,7 +467,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); @@ -493,9 +496,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); } @@ -541,7 +544,7 @@ rct_window* window_ride_construction_open() w->colours[1] = COLOUR_DARK_BROWN; w->colours[2] = COLOUR_DARK_BROWN; - w->number = rideIndex; + w->rideId = rideIndex; window_push_others_right(w); show_gridlines(); @@ -563,7 +566,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; @@ -618,7 +621,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, EnumValue(ride->id)); context_open_intent(&intent); } else @@ -686,7 +689,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 +770,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 +1004,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 +1013,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 +1150,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 +1160,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 +1176,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 +1184,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 +1196,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) @@ -1313,21 +1316,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; @@ -1344,7 +1347,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; @@ -1363,7 +1366,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; @@ -1374,24 +1377,24 @@ 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: ride_construction_invalidate_current_track(); - if (_rideConstructionState == 2 && _currentTrackBankEnd != TRACK_BANK_NONE) + if (_rideConstructionState == RideConstructionState::Back && _currentTrackBankEnd != TRACK_BANK_NONE) { _currentTrackBankEnd = TRACK_BANK_NONE; } - loc_6C7502(6); + UpdateLiftHillSelected(TRACK_SLOPE_DOWN_25); 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 +1405,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) { @@ -1413,17 +1416,17 @@ 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(); - 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(); @@ -1431,7 +1434,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: @@ -1445,21 +1448,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; @@ -1476,7 +1479,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; @@ -1495,7 +1498,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; @@ -1506,20 +1509,18 @@ 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: 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; @@ -1547,7 +1548,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 +1574,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); } @@ -1597,14 +1598,15 @@ 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; 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 +1620,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); } @@ -1662,13 +1664,13 @@ 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) { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_0) + if (_rideConstructionState == RideConstructionState::State0) { auto w = window_find_by_class(WC_RIDE_CONSTRUCTION); if (w != nullptr) @@ -1685,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) { @@ -1711,14 +1713,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(); @@ -1730,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) { @@ -1756,14 +1758,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 +1798,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); } @@ -1808,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; @@ -1831,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); } @@ -1863,31 +1865,32 @@ 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??? direction = _currentTrackPieceDirection; track_type_t type = _currentTrackPieceType; - auto newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); - if (newCoords == std::nullopt) + auto newCoords = GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); + if (!newCoords.has_value()) { window_ride_construction_update_active_elements(); return; @@ -1916,23 +1919,35 @@ 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) + if (!newCoords.has_value()) { window_ride_construction_update_active_elements(); return; } - const rct_preview_track* trackBlock = TrackBlocks[tileElement->AsTrack()->GetTrackType()]; + const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + 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); + 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); + } } auto trackRemoveAction = TrackRemoveAction( _currentTrackPieceType, 0, { _currentTrackBegin.x, _currentTrackBegin.y, _currentTrackBegin.z, _currentTrackPieceDirection }); + const auto rideId = w->rideId; trackRemoveAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) { @@ -1940,7 +1955,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; @@ -1982,14 +1997,14 @@ 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(); - 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(); } @@ -2012,14 +2027,14 @@ static void window_ride_construction_exit_click(rct_window* w) else { gRideEntranceExitPlaceType = ENTRANCE_TYPE_RIDE_EXIT; - gRideEntranceExitPlaceRideIndex = w->number & 0xFF; + gRideEntranceExitPlaceRideIndex = w->rideId; 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 +2068,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 +2077,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,17 +2088,19 @@ 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(); + UpdateGhostTrackAndArrow(); } /** @@ -2132,7 +2149,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; } @@ -2152,7 +2169,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; @@ -2171,9 +2188,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 { @@ -2323,13 +2340,15 @@ 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 }); + if (_rideConstructionState != RideConstructionState::Place) + DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); screenCoords.y += 11; if (_currentTrackPrice != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { - DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, static_cast(&_currentTrackPrice), { TextAlignment::CENTRE }); + auto ft = Formatter(); + ft.Add(_currentTrackPrice); + DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); } } @@ -2341,7 +2360,8 @@ static void window_ride_construction_draw_track_piece( if (ride == nullptr) return; - auto trackBlock = TrackBlocks[trackType]; + const auto& ted = GetTrackElementDescriptor(trackType); + const auto* trackBlock = ted.Block; while ((trackBlock + 1)->index != 0xFF) trackBlock++; @@ -2358,7 +2378,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); @@ -2391,17 +2411,12 @@ 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]; + const auto& ted = GetTrackElementDescriptor(trackType); + const auto* trackBlock = ted.Block; while (trackBlock->index != 255) { auto quarterTile = trackBlock->var_08.Rotate(trackDirection); @@ -2419,11 +2434,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); @@ -2439,6 +2454,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); @@ -2459,10 +2475,7 @@ static void sub_6CBCE2( trackBlock++; } - gMapSizeUnits = preserveMapSizeUnits; - gMapSizeMinus2 = preserveMapSizeMinus2; gMapSize = preserveMapSize; - gMapSizeMaxXY = preserveMapSizeMaxXY; PaintSessionArrange(session); PaintDrawStructs(session); @@ -2486,9 +2499,9 @@ 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( + if (GetTrackElementOriginAndApplyChanges( { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, &tileElement, 0) != std::nullopt) @@ -2526,7 +2539,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; @@ -2547,9 +2560,10 @@ void sub_6C94D8() switch (_rideConstructionState) { - case RIDE_CONSTRUCTION_STATE_FRONT: - case RIDE_CONSTRUCTION_STATE_BACK: + case RideConstructionState::Front: + case RideConstructionState::Back: { + // place ghost piece if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)) { if (window_ride_construction_update_state( @@ -2564,7 +2578,7 @@ void sub_6C94D8() window_ride_construction_update_active_elements(); } } - + // update flashing arrow auto curTime = platform_get_ticks(); if (_rideConstructionNextArrowPulse >= curTime) break; @@ -2574,9 +2588,10 @@ void sub_6C94D8() trackPos = _currentTrackBegin; direction = _currentTrackPieceDirection; type = _currentTrackPieceType; + // diagonal pieces trigger this if (direction >= 4) direction += 4; - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + if (_rideConstructionState == RideConstructionState::Back) direction = direction_reverse(direction); gMapSelectArrowPosition = trackPos; gMapSelectArrowDirection = direction; @@ -2586,7 +2601,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) @@ -2598,17 +2613,18 @@ 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); - if (newCoords == std::nullopt) + auto newCoords = GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(direction) }, type, 0, nullptr, flags); + if (!newCoords.has_value()) { 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::MazeBuild: + case RideConstructionState::MazeMove: + case RideConstructionState::MazeFill: { auto curTime = platform_get_ticks(); if (_rideConstructionNextArrowPulse >= curTime) @@ -2635,6 +2651,8 @@ void sub_6C94D8() map_invalidate_tile_full(trackPos); break; } + default: + break; } } @@ -2653,17 +2671,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: @@ -2702,7 +2720,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; @@ -2713,15 +2732,15 @@ 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; + slope = ted.Definition.vangle_start; + bank = ted.Definition.bank_start; } - else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + 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 { @@ -2730,7 +2749,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) { @@ -3164,22 +3183,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; @@ -3295,7 +3314,8 @@ static void window_ride_construction_select_map_tiles( const rct_preview_track* trackBlock; - trackBlock = TrackBlocks[trackType]; + const auto& ted = GetTrackElementDescriptor(trackType); + trackBlock = ted.Block; trackDirection &= 3; gMapSelectionTiles.clear(); while (trackBlock->index != 255) @@ -3352,7 +3372,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(); @@ -3362,15 +3382,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 == RIDE_CONSTRUCTION_STATE_FRONT) + 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(); @@ -3384,7 +3410,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) @@ -3472,7 +3498,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& ted = GetTrackElementDescriptor(trackType); + trackBlock = ted.Block; int32_t bx = 0; do { @@ -3504,7 +3531,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; @@ -3540,7 +3566,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]; @@ -3550,17 +3576,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))) { @@ -3568,12 +3595,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; @@ -3584,7 +3611,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; @@ -3702,7 +3729,8 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) if (_trackPlaceZ == 0) { - const rct_preview_track* trackBlock = TrackBlocks[_currentTrackPieceType]; + const auto& ted = GetTrackElementDescriptor(_currentTrackPieceType); + const rct_preview_track* trackBlock = ted.Block; int32_t bx = 0; do { @@ -3729,7 +3757,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::MazeBuild; _currentTrackBegin.x = mapCoords.x; _currentTrackBegin.y = mapCoords.y; _currentTrackBegin.z = z; @@ -3750,7 +3778,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 @@ -3785,7 +3813,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-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index e61ef1db77..0769686996 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 @@ -69,25 +71,26 @@ 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, }; +// 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; @@ -101,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, @@ -117,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] = { @@ -135,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] = { @@ -145,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[] = { @@ -167,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; @@ -198,7 +201,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 +229,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 +238,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 +407,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 +430,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) { @@ -449,7 +445,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, EnumValue(rideIndex)); context_open_intent(&intent); } } @@ -460,10 +456,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 +515,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) { @@ -560,9 +554,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(static_cast(_rideList.size())); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_LIST].bottom + 2 }, ride_list_statusbar_count_strings[w->page], - &w->no_list_items); + ft); } /** @@ -576,18 +572,18 @@ 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); + gfx_filter_rect(dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1); format = (_quickDemolishMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID); } // Get ride - auto ride = get_ride(w->list_item_positions[i]); + auto ride = get_ride(_rideList[i]); if (ride == nullptr) continue; @@ -632,10 +628,10 @@ 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); + ft.Add(ride->profit); } break; case INFORMATION_TYPE_TOTAL_CUSTOMERS: @@ -644,10 +640,10 @@ 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); + ft.Add(ride->total_profit); } break; case INFORMATION_TYPE_CUSTOMERS: @@ -674,10 +670,10 @@ 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); + ft.Add(ride->income_per_hour); } break; case INFORMATION_TYPE_RUNNING_COST: @@ -685,7 +681,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: @@ -781,13 +777,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; @@ -800,8 +808,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: @@ -809,7 +817,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(); @@ -824,7 +832,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) @@ -837,7 +845,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) @@ -850,7 +858,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) @@ -863,7 +871,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) @@ -876,7 +884,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) @@ -889,7 +897,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)) @@ -902,7 +910,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) @@ -915,7 +923,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) @@ -928,7 +936,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) @@ -941,7 +949,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()) @@ -954,7 +962,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()) @@ -967,7 +975,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) @@ -980,7 +988,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) @@ -993,7 +1001,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) @@ -1008,7 +1016,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-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index cb320b9d40..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] = { @@ -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); } @@ -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, std::string{ gS6Info.name }); - } - 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 c29d950b22..5c219c7ea2 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[] = { @@ -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) @@ -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; @@ -246,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; } } @@ -493,9 +492,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 @@ -535,7 +534,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 +550,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); } } @@ -564,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(); @@ -597,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/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 1112dd9286..9d58e17215 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,67 +68,28 @@ 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); 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 - 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 @@ -171,61 +98,198 @@ 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 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(const ScenerySelection& entry) const + { + return std::find(std::begin(Entries), std::end(Entries), entry) != std::end(Entries); + } + + void AddEntry(const 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 const ScenerySelection GetSelectedScenery(const size_t tabIndex) +{ + if (gWindowSceneryTabSelections.size() > tabIndex) + { + return gWindowSceneryTabSelections[tabIndex]; + } + return {}; +} + +static void SetSelectedScenery(const size_t tabIndex, const ScenerySelection& value) +{ + if (gWindowSceneryTabSelections.size() <= tabIndex) + { + gWindowSceneryTabSelections.resize(tabIndex + 1); + } + gWindowSceneryTabSelections[tabIndex] = value; +} + +static SceneryTabInfo* GetSceneryTabInfoForGroup(const 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]; + if (tabInfo.Contains(scenery)) + { + return i; + } + } + return std::nullopt; +} + +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 + 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); + if (tabInfo != nullptr) { - if (window_scenery_tab_entries[sceneryTabId][i].IsUndefined()) - { - window_scenery_tab_entries[sceneryTabId][i] = selection; - window_scenery_tab_entries[sceneryTabId][i + 1].SetUndefined(); - return; - } + 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.has_value()) { - 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; + + 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 : WindowSceneryBaseWidgets) + { + _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 + { + const 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 +297,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 && scenery_group_is_invented(scenerySetIndex)) { - 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(); + const 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 +407,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 +420,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 +437,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 +454,14 @@ rct_window* window_scenery_open() return window; } -/** +static int32_t window_scenery_get_num_columns(const rct_window* w) +{ + const auto* listWidget = &w->widgets[WIDX_SCENERY_LIST]; + const auto contentWidth = listWidget->width() - SCROLLBAR_WIDTH; + return contentWidth / SCENERY_BUTTON_WIDTH; +} + +/* * * rct2: 0x006E1A73 */ @@ -492,10 +478,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(const rct_window* w, T items) { - int32_t rows = items / 9; + const auto rows = items / window_scenery_get_num_columns(w); + return rows; +} +static size_t window_scenery_count_rows(const rct_window* w) +{ + const auto tabIndex = gWindowSceneryActiveTabIndex; + if (tabIndex >= _tabEntries.size()) + { + return 0; + } + + 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; } @@ -506,46 +505,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, const 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(const 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 +588,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; + const auto tabIndex = gWindowSceneryActiveTabIndex; + if (tabIndex >= _tabEntries.size()) + { + return; + } - scenery_item sceneryItem = window_scenery_count_rows_with_selected_item(tabIndex); + const int32_t listHeight = w->height - 14 - w->widgets[WIDX_SCENERY_LIST].top - 1; + + 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); - int32_t rowSelected = count_rows(sceneryItem.selected_item); + 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; - ScenerySelection scenery = window_scenery_tab_entries[tabIndex][0]; + const 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 +677,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(); @@ -725,15 +712,39 @@ 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 */ static void window_scenery_periodic_update(rct_window* w) { - if (!w->scenery.SelectedScenery.IsUndefined()) + if (!_selectedScenery.IsUndefined()) { - w->scenery.SelectedScenery = ScenerySelection::CreateUndefined(); + // 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 = {}; } } @@ -754,8 +765,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 +778,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]; + const auto nonListHeight = w->height - listWidget.height() + 2; + + 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; @@ -782,7 +796,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 +824,8 @@ static void window_scenery_update(rct_window* w) } else { - uint16_t tabIndex = gWindowSceneryActiveTabIndex; - ScenerySelection tabSelectedScenery = gWindowSceneryTabSelections[tabIndex]; - + const auto tabIndex = gWindowSceneryActiveTabIndex; + const auto tabSelectedScenery = GetSelectedScenery(tabIndex); if (!tabSelectedScenery.IsUndefined()) { if (tabSelectedScenery.SceneryType == SCENERY_TYPE_BANNER) @@ -845,26 +858,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) + 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) { - scenery = window_scenery_tab_entries[tabIndex][itemCounter]; - if (scenery.IsUndefined()) - return ScenerySelection::CreateUndefined(); - - itemCounter++; + const auto tabSceneryIndex = static_cast((rowIndex * numColumns) + colIndex); + const auto tabIndex = gWindowSceneryActiveTabIndex; + if (tabIndex < _tabEntries.size()) + { + auto& tabInfo = _tabEntries[tabIndex]; + if (tabSceneryIndex < tabInfo.Entries.size()) + { + return tabInfo.Entries[tabSceneryIndex]; + } + } } - return scenery; } @@ -874,17 +891,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); + const auto 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 +911,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 +925,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; + const auto tabIndex = static_cast(widgetIndex - WIDX_SCENERY_TAB_1); + if (_tabEntries.size() > tabIndex) + { + const auto& tabInfo = _tabEntries[tabIndex]; + if (tabInfo.IsMisc()) + { + auto ft = Formatter(); + ft.Add(STR_MISCELLANEOUS); + return { fallback, ft }; + } + + const 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 +956,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; + const 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 +979,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]; + const 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 (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; + 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 +1035,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 +1043,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; } } } @@ -1060,42 +1069,118 @@ 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; + w->widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) - window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) + 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) + { + const 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 }; } /** @@ -1106,17 +1191,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; + const 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 @@ -1124,62 +1210,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( @@ -1192,29 +1232,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]; + const 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 } }, @@ -1229,7 +1376,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 } }, @@ -1241,116 +1388,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 (scenery_small_entry_has_flag(sceneryEntry, 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)) - { - imageId |= (gWindowScenerySecondaryColour << 24) | IMAGE_TYPE_REMAP_2_PLUS; - } - } - - 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)) - { - spriteTop -= 0x0C; - } - - gfx_draw_sprite(&clipdpi, imageId, { 0x20, spriteTop }, w->colours[1]); - - if (scenery_small_entry_has_flag(sceneryEntry, 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 (scenery_small_entry_has_flag(sceneryEntry, 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; @@ -1358,36 +1400,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; @@ -1399,8 +1425,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/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index fa1c438dc7..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 @@ -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) @@ -216,8 +218,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..ffd85a95d7 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 }, + 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 { @@ -107,10 +109,9 @@ enum DDIDX_FAVOURITE }; -static int32_t _hoverButtonIndex = -1; +static bool _showNetworkVersionTooltip = false; 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); @@ -194,7 +195,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); @@ -260,7 +261,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,52 +272,36 @@ 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); } } 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) + auto& listWidget = w->widgets[WIDX_LIST]; + + int32_t itemIndex = screenCoords.y / ITEM_HEIGHT; + bool showNetworkVersionTooltip = false; + if (itemIndex < 0 || itemIndex >= w->no_list_items) { - index = -1; + itemIndex = -1; + } + else + { + const int32_t iconX = listWidget.width() - SCROLLBAR_WIDTH - 7 - 10; + showNetworkVersionTooltip = screenCoords.x > iconX; } - int32_t hoverButtonIndex = -1; - if (index != -1) + if (w->selected_list_item != itemIndex || _showNetworkVersionTooltip != showNetworkVersionTooltip) { - int32_t width = w->widgets[WIDX_LIST].width(); - int32_t sy = index * ITEM_HEIGHT; - for (int32_t i = 0; i < 2; i++) - { - int32_t bx, by; + w->selected_list_item = itemIndex; + _showNetworkVersionTooltip = showNetworkVersionTooltip; - 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 = w->widgets[WIDX_LIST].width(); - int32_t right = width - 3 - 14 - 10; - if (screenCoords.x < right) - { - w->widgets[WIDX_LIST].tooltip = STR_NONE; + listWidget.tooltip = showNetworkVersionTooltip ? static_cast(STR_NETWORK_VERSION_TIP) : STR_NONE; window_tooltip_close(); - } - if (w->selected_list_item != index || _hoverButtonIndex != hoverButtonIndex) - { - w->selected_list_item = index; - _hoverButtonIndex = hoverButtonIndex; - window_tooltip_close(); w->Invalidate(); } } @@ -401,19 +386,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) @@ -421,11 +406,11 @@ 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; for (int32_t i = 0; i < w->no_list_items; i++) { if (screenCoords.y >= dpi->y + dpi->height) @@ -437,9 +422,8 @@ 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; - w->widgets[WIDX_LIST].tooltip = STR_NETWORK_VERSION_TIP; } colour_t colour = w->colours[1]; @@ -512,12 +496,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; 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 0f01475ba5..4a72589e58 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 @@ -350,10 +350,8 @@ private: } return true; } - else - { - return group == groupFilter; - } + + return group == groupFilter; } void InitialiseList() @@ -437,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); @@ -511,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/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index fd4f8176eb..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 @@ -58,14 +58,15 @@ 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(); - window_text_input_raw_open(this, WIDX_SIGN_TEXT, STR_SIGN_TEXT_TITLE, STR_SIGN_TEXT_PROMPT, bannerText.c_str(), 32); + 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 +88,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; @@ -125,10 +127,9 @@ public: // Create viewport rct_widget& viewportWidget = window_sign_widgets[WIDX_VIEWPORT]; - 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(CoordsXYZ{ signViewPosition, viewZ })); viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; Invalidate(); @@ -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: @@ -149,8 +156,9 @@ public: if (tileElement == nullptr) { Close(); + return; } - auto bannerCoords = _banner->position.ToCoordsXY(); + auto bannerCoords = banner->position.ToCoordsXY(); if (_isSmall) { @@ -282,6 +290,10 @@ public: RemoveViewport(); auto banner = GetBanner(number); + if (banner == nullptr) + { + return; + } auto signViewPos = CoordsXYZ{ banner->position.ToCoordsXY().ToTileCentre(), frame_no }; @@ -289,7 +301,7 @@ public: rct_widget* viewportWidget = &window_sign_widgets[WIDX_VIEWPORT]; 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(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 4ffd184587..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 */ \ @@ -86,7 +88,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,63 +100,65 @@ 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, }; +// clang-format on -//0x9AF9F4 +// 0x9AF9F4 static rct_widget window_staff_stats_widgets[] = { MAIN_STAFF_WIDGETS, - { WIDGETS_END }, + 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_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; @@ -173,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; @@ -186,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; @@ -196,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) | @@ -265,7 +268,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; @@ -356,7 +358,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; @@ -382,7 +384,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; } @@ -408,20 +410,17 @@ 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; 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) 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); } @@ -440,7 +439,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; } } @@ -484,8 +483,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; @@ -509,30 +507,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 (!peep->HasPatrolArea()) + { + Dropdown::SetDisabled(1, true); + } + } } } @@ -542,38 +544,63 @@ 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; + } - // Clear patrol - if (dropdownIndex == 1) - { - const auto peep = GetStaff(w); - if (peep == nullptr) - { - return; + auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction( + peep->sprite_index, {}, StaffSetPatrolAreaMode::ClearAll); + GameActions::Execute(&staffSetPatrolAreaAction); + } + 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); } /** @@ -922,7 +949,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; @@ -940,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 }); } @@ -955,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); } @@ -977,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); } @@ -998,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++; @@ -1071,7 +1094,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; } @@ -1138,7 +1161,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 +1208,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 +1226,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); @@ -1218,7 +1241,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); } } @@ -1239,7 +1264,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); @@ -1252,7 +1277,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); } @@ -1314,9 +1341,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) @@ -1324,23 +1349,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 = Focus(peep->sprite_index); } uint16_t viewport_flags; - if (w->viewport) + if (w->viewport != nullptr) { - // 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->focus) return; viewport_flags = w->viewport->flags; @@ -1355,28 +1373,25 @@ 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->focus = focus; if (peep->State != PeepState::Picked) { - if (!(w->viewport)) + 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, 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(); } } - if (w->viewport) + if (w->viewport != nullptr) w->viewport->flags = viewport_flags; w->Invalidate(); } diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index 91f86d50e9..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; @@ -34,7 +35,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 52053bf080..5004cf4cac 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 @@ -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); } @@ -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); } @@ -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 }); } @@ -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); @@ -566,7 +566,7 @@ private: if (isPatrolAreaSet) { - if (gStaffModes[peep->StaffId] != StaffMode::Patrol) + if (!peep->HasPatrolArea()) { continue; } diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 011a457914..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 @@ -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) @@ -202,14 +204,15 @@ 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 { DrawTextWrapped( - &dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, &TextInputDescriptionArgs, + &dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, _descriptionArgs, { colours[1], TextAlignment::CENTRE }); } @@ -370,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); @@ -379,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); } } @@ -400,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..e154e16e09 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 @@ -123,7 +124,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[] = { @@ -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; @@ -359,7 +360,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 +383,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; @@ -866,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/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index e0ad6f530e..69519de644 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -32,8 +32,8 @@ #include #include #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, @@ -43,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, @@ -179,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; @@ -199,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)) @@ -240,7 +242,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 @@ -258,7 +260,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 @@ -278,7 +280,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 @@ -292,7 +294,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 @@ -310,7 +312,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, }; @@ -322,7 +324,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 @@ -335,7 +337,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 @@ -345,7 +347,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 @@ -360,7 +362,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 @@ -371,7 +373,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[] = { @@ -386,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; @@ -402,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, @@ -438,10 +441,9 @@ 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) -{ +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; @@ -456,8 +458,10 @@ 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; }); +// 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), @@ -542,10 +546,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 +769,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) @@ -806,6 +819,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; @@ -1216,10 +1233,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(); } } @@ -1269,12 +1286,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) @@ -1287,6 +1304,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); } @@ -1805,7 +1824,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 +1835,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 +1852,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 +1871,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 +1886,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()->GetSurfaceDescriptor()->Name); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE }); // Path addition if (tileElement->AsPath()->HasAddition()) @@ -1873,9 +1898,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 +1916,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 @@ -1902,38 +1929,45 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) case TILE_ELEMENT_TYPE_TRACK: { - // Details - // Ride auto trackElement = tileElement->AsTrack(); - int16_t rideId = trackElement->GetRideIndex(); + ride_id_t rideId = trackElement->GetRideIndex(); auto ride = get_ride(rideId); + + // Ride ID + auto ft = Formatter(); + ft.Add(rideId); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_ID, ft, { COLOUR_WHITE }); + + // Ride name if (ride != nullptr) { - auto rideName = ride->GetRideTypeDescriptor().Naming.Name; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, &rideName, { COLOUR_WHITE }); - } - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_ID, &rideId, { 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 }); + 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. + const auto& rtd = GetRideTypeDescriptor(trackElement->GetRideType()); + ft = Formatter(); + ft.Add(rtd.Naming.Name); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, ft, { 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 +1976,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 +1995,9 @@ 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 = Formatter(); + ft.Add(tileElement->base_height); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); break; } @@ -1970,27 +2005,32 @@ 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(); - 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, - 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( - 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 +2039,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 +2059,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 +2123,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 +2133,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 && !banner->IsNull()) + 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 +2161,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 +2181,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 +2192,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 @@ -2160,9 +2209,9 @@ 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; + ft = Formatter(); banner->FormatTextTo(ft); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, @@ -2183,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_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; } @@ -2193,7 +2243,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); @@ -2207,8 +2257,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 +2277,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 +2381,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 +2397,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/TitleCommandEditor.cpp b/src/openrct2-ui/windows/TitleCommandEditor.cpp index 718964cefd..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 @@ -106,7 +107,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); @@ -227,9 +228,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 = Focus(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 +478,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/TitleEditor.cpp b/src/openrct2-ui/windows/TitleEditor.cpp index 78b48d5211..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 @@ -171,34 +172,34 @@ 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, }; +// 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) { @@ -280,14 +281,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 +304,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 +340,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); } } @@ -351,9 +353,9 @@ 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()); + objectMgr.LoadObjects(result.RequiredObjects); parkImporter->Import(); if (isScenario) @@ -1140,7 +1142,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/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 5c0d53c84b..e9c3ac91d2 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,7 +55,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -68,8 +70,8 @@ using namespace OpenRCT2; using namespace OpenRCT2::Ui; -// clang-format off -enum { +enum +{ WIDX_PAUSE, WIDX_FILE_MENU, WIDX_MUTE, @@ -108,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, @@ -119,13 +122,15 @@ 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, + DDIDX_UPDATE_AVAILABLE = 11, // separator - DDIDX_UPDATE_AVAILABLE = 13, + DDIDX_QUIT_TO_MENU = 13, + 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, @@ -144,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, @@ -173,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, @@ -206,7 +217,6 @@ static constexpr const int32_t left_aligned_widgets_order[] = { WIDX_ROTATE, WIDX_VIEW_MENU, WIDX_MAP, - }; // from right to left @@ -226,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 @@ -259,22 +269,22 @@ 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, }; +// 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; @@ -286,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); @@ -308,8 +317,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(); @@ -423,62 +432,73 @@ 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_FILE_BUG_ON_GITHUB; + + if (OpenRCT2::GetContext()->HasNewVersionInfo()) + gDropdownItemsFormat[numItems++] = STR_UPDATE_AVAILABLE; + + gDropdownItemsFormat[numItems++] = STR_EMPTY; if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - gDropdownItemsFormat[5] = STR_QUIT_ROLLERCOASTER_DESIGNER; + gDropdownItemsFormat[numItems++] = STR_QUIT_ROLLERCOASTER_DESIGNER; + else + gDropdownItemsFormat[numItems++] = STR_QUIT_TRACK_DESIGNS_MANAGER; - numItems = 7; + gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; } 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_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; } 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_FILE_BUG_ON_GITHUB; + if (OpenRCT2::GetContext()->HasNewVersionInfo()) - { - gDropdownItemsFormat[12] = STR_EMPTY; - gDropdownItemsFormat[13] = STR_UPDATE_AVAILABLE; - numItems += 2; - } + gDropdownItemsFormat[numItems++] = STR_UPDATE_AVAILABLE; + + gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_QUIT_TO_MENU; + gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; } + WindowDropdownShowText( { w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[0] | 0x80, Dropdown::Flag::StayOpen, numItems); @@ -537,6 +557,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: @@ -561,7 +585,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 @@ -582,6 +606,18 @@ 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_UPDATE_AVAILABLE: + context_open_window_view(WV_NEW_VERSION_INFO); + break; case DDIDX_QUIT_TO_MENU: { window_close_by_class(WC_MANAGE_TRACK_DESIGN); @@ -593,9 +629,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: @@ -661,13 +694,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) @@ -675,6 +719,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; @@ -685,20 +732,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; @@ -711,39 +758,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; @@ -998,8 +1025,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(); @@ -1207,7 +1233,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; } @@ -1233,7 +1259,7 @@ static void sub_6E1F34_small_scenery( if (w == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1243,7 +1269,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; } @@ -1251,7 +1277,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; @@ -1259,12 +1285,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(); + gridPos.SetNull(); return; } - gridPos = *gridCoords; + gridPos = gridCoords.value(); gSceneryPlaceZ = 0; @@ -1275,7 +1301,7 @@ static void sub_6E1F34_small_scenery( if (surfaceElement == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1292,12 +1318,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(); + gridPos.SetNull(); return; } - gridPos = *mapCoords; + gridPos = mapCoords.value(); // If SHIFT pressed if (gSceneryShiftPressed) @@ -1310,12 +1336,12 @@ static void sub_6E1F34_small_scenery( gSceneryPlaceZ = z; } - if (gridPos.isNull()) + if (gridPos.IsNull()) return; 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; } @@ -1344,7 +1370,7 @@ static void sub_6E1F34_small_scenery( if (info.SpriteType == ViewportInteractionItem::None) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1358,7 +1384,7 @@ static void sub_6E1F34_small_scenery( if (surfaceElement == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1374,13 +1400,13 @@ 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; } else { - gridPos.setNull(); + gridPos.SetNull(); } // If SHIFT pressed if (gSceneryShiftPressed) @@ -1393,13 +1419,13 @@ static void sub_6E1F34_small_scenery( gSceneryPlaceZ = z; } - if (gridPos.isNull()) + if (gridPos.IsNull()) return; 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; } @@ -1423,7 +1449,7 @@ static void sub_6E1F34_path_item( if (w == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1437,7 +1463,7 @@ static void sub_6E1F34_path_item( if (info.SpriteType == ViewportInteractionItem::None) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1456,7 +1482,7 @@ static void sub_6E1F34_wall( if (w == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1477,12 +1503,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(); + gridPos.SetNull(); return; } - gridPos = *gridCoords; + gridPos = gridCoords.value(); gSceneryPlaceZ = 0; @@ -1493,7 +1519,7 @@ static void sub_6E1F34_wall( if (surfaceElement == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1509,12 +1535,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(); + gridPos.SetNull(); return; } - gridPos = *mapCoords; + gridPos = mapCoords.value(); // If SHIFT pressed if (gSceneryShiftPressed) @@ -1527,7 +1553,7 @@ static void sub_6E1F34_wall( gSceneryPlaceZ = z; } - if (gridPos.isNull()) + if (gridPos.IsNull()) return; if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) @@ -1545,7 +1571,7 @@ static void sub_6E1F34_large_scenery( if (w == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1572,7 +1598,7 @@ static void sub_6E1F34_large_scenery( const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenPos); gridPos = mapCoords; - if (gridPos.isNull()) + if (gridPos.IsNull()) return; gSceneryPlaceZ = 0; @@ -1584,7 +1610,7 @@ static void sub_6E1F34_large_scenery( if (surfaceElement == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1600,13 +1626,13 @@ 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; } else { - gridPos.setNull(); + gridPos.SetNull(); } // If SHIFT pressed @@ -1620,7 +1646,7 @@ static void sub_6E1F34_large_scenery( gSceneryPlaceZ = z; } - if (gridPos.isNull()) + if (gridPos.IsNull()) return; gridPos = gridPos.ToTileStart(); @@ -1645,7 +1671,7 @@ static void sub_6E1F34_banner( if (w == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1659,7 +1685,7 @@ static void sub_6E1F34_banner( if (info.SpriteType == ViewportInteractionItem::None) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1698,19 +1724,18 @@ 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; } - 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) @@ -1720,7 +1745,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; @@ -1757,7 +1782,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; } @@ -1772,7 +1797,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; } @@ -1840,7 +1865,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); @@ -1859,7 +1884,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; @@ -1880,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) { @@ -1911,7 +1936,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; @@ -1933,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) { @@ -1969,23 +1994,18 @@ 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 }; 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); + auto bannerPlaceAction = BannerPlaceAction(loc, selectedScenery, primaryColour); bannerPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { + auto data = result->GetData(); OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - context_open_detail_window(WD_BANNER, bannerIndex); + context_open_detail_window(WD_BANNER, data.bannerId); } }); GameActions::Execute(&bannerPlaceAction); @@ -2003,11 +2023,11 @@ 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 != MONEY32_UNDEFINED) + if (gClearSceneryCost != MONEY64_UNDEFINED) { - gClearSceneryCost = MONEY32_UNDEFINED; + gClearSceneryCost = MONEY64_UNDEFINED; window_invalidate_by_class(WC_CLEAR_SCENERY); } return state_changed; @@ -2075,7 +2095,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; @@ -2098,8 +2118,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) { @@ -2122,10 +2142,10 @@ 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()) { - 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) { @@ -2184,8 +2204,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) { @@ -2199,10 +2219,10 @@ 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()) { - 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) { @@ -2310,8 +2330,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) { @@ -2340,10 +2360,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) { @@ -2361,10 +2381,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; @@ -2432,10 +2452,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) { @@ -2448,10 +2468,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(); @@ -2460,18 +2480,18 @@ static money32 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) - return MONEY32_UNDEFINED; + 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); @@ -2486,7 +2506,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(); @@ -2503,12 +2523,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) { @@ -2517,11 +2537,12 @@ static money32 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; @@ -2529,12 +2550,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(); @@ -2543,14 +2564,15 @@ static money32 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) - return MONEY32_UNDEFINED; + 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); @@ -2565,23 +2587,17 @@ 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(); // 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) - return MONEY32_UNDEFINED; + return MONEY64_UNDEFINED; gSceneryGhostPosition = loc; gSceneryGhostPosition.z += PATH_HEIGHT_STEP; @@ -2612,15 +2628,19 @@ 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(); return; } - money32 cost = 0; + money64 cost = 0; switch (selection.SceneryType) { @@ -2632,7 +2652,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; @@ -2663,7 +2683,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); } @@ -2695,7 +2715,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; } @@ -2710,7 +2730,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; @@ -2745,7 +2765,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; @@ -2785,7 +2805,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; } @@ -2800,7 +2820,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; @@ -2851,7 +2871,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; } @@ -2867,7 +2887,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; @@ -2995,7 +3015,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; @@ -3010,25 +3030,23 @@ 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 - { - 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 : MONEY32_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; } /** * * 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; @@ -3043,18 +3061,16 @@ 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 - { - 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 : MONEY32_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; } /** @@ -3064,16 +3080,16 @@ static money32 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) 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) + if (viewport == nullptr) return; int16_t tile_height = -16 / viewport->zoom; @@ -3086,8 +3102,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) { @@ -3095,8 +3111,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; } } @@ -3112,11 +3128,11 @@ 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) + if (viewport == nullptr) return; int16_t dx = -16 / viewport->zoom; @@ -3131,8 +3147,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; } @@ -3146,8 +3162,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; } @@ -3285,7 +3301,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; } @@ -3313,7 +3329,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++; } @@ -3467,6 +3483,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) @@ -3560,7 +3577,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) { @@ -3587,7 +3604,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) { @@ -3683,7 +3700,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) { diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 10d541600d..4cb72f6932 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 @@ -38,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(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 } + WIDGETS_END, }; #pragma endregion @@ -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,12 +133,13 @@ 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: 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(); @@ -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); @@ -243,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 + 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, ft, { TextAlignment::CENTRE }); } static void window_track_design_list_reload_tracks() diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 2508daf583..24943c1148 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; @@ -66,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); @@ -151,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(); @@ -192,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: @@ -258,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; @@ -267,7 +268,8 @@ 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(PreviewRideId), { mapCoords, 0 }); return; } @@ -287,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; } @@ -307,7 +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(0), trackLoc); + place_virtual_track(_trackDesign.get(), PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(PreviewRideId), trackLoc); } /** @@ -323,7 +325,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 @@ -334,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, 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); @@ -468,7 +471,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(PreviewRideId), { loc, z }); } /** @@ -497,9 +502,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)) { - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, &_window_track_place_last_cost, - { TextAlignment::CENTRE }); + ft = Formatter(); + ft.Add(_window_track_place_last_cost); + DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); } } @@ -550,7 +555,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& ted = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = ted.Block; while (trackBlock->index != 255) { auto rotatedAndOffsetTrackBlock = curTrackStart + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(curTrackRotation); @@ -572,9 +578,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 = (TrackSequenceProperties[trackType][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++) { @@ -594,7 +599,8 @@ 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]; + + 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-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 88ab3fd192..e52238097b 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -57,61 +57,708 @@ 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); -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_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; + 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) + { + window_close_by_number(WC_MANAGE_TRACK_DESIGN, number); + window_close_by_number(WC_TRACK_DELETE_PROMPT, number); + 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, { 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, { 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,685 +770,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 - fixed32_2dp rating = _loadedTrackDesign->excitement * 10; - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, &rating); - screenPos.y += LIST_ROW_HEIGHT; - - rating = _loadedTrackDesign->intensity * 10; - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, &rating); - screenPos.y += LIST_ROW_HEIGHT; - - rating = _loadedTrackDesign->nausea * 10; - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, &rating); - 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 - uint16_t holes = _loadedTrackDesign->holes & 0x1F; - DrawTextBasic(dpi, screenPos, STR_HOLES, &holes); - screenPos.y += LIST_ROW_HEIGHT; - } - else - { - // Maximum speed - uint16_t speed = ((_loadedTrackDesign->max_speed << 16) * 9) >> 18; - DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, &speed); - screenPos.y += LIST_ROW_HEIGHT; - - // Average speed - speed = ((_loadedTrackDesign->average_speed << 16) * 9) >> 18; - DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, &speed); - 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 - int32_t gForces = _loadedTrackDesign->max_positive_vertical_g * 32; - DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, &gForces); - 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); - screenPos.y += LIST_ROW_HEIGHT; - - // Maximum lateral Gs - gForces = _loadedTrackDesign->max_lateral_g * 32; - DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, &gForces); - 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); - screenPos.y += LIST_ROW_HEIGHT; - } - } - - if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) - { - // Drops - uint16_t drops = _loadedTrackDesign->drops & 0x3F; - DrawTextBasic(dpi, screenPos, STR_DROPS, &drops); - 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); - screenPos.y += LIST_ROW_HEIGHT; - } - - if (_loadedTrackDesign->type != RIDE_TYPE_MINI_GOLF) - { - uint16_t inversions = _loadedTrackDesign->inversions & 0x1F; - if (inversions != 0) - { - // Inversions - DrawTextBasic(dpi, screenPos, STR_INVERSIONS, &inversions); - 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; - } - - rct_string_id stringId2 = STR_BUILD_CUSTOM_DESIGN; - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, &stringId2); - 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; -} diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index aa7b185ef1..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; @@ -59,379 +57,353 @@ 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 -#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 - -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{ false }; + bool _dragging{ false }; + static inline DISPLAY_TYPE _clipHeightDisplayType; -rct_window* window_view_clipping_open() -{ - rct_window* 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) +public: + void OnCloseButton() { - return window; + OnClose(); } - // 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) + void OnMouseUp(rct_widgetindex widgetIndex) override { - mainWindow->viewport->flags |= VIEWPORT_FLAG_CLIP_VIEW; - mainWindow->Invalidate(); + // mouseup appears to be used for buttons, checkboxes + switch (widgetIndex) + { + case WIDX_CLOSE: + window_close(this); + break; + case WIDX_CLIP_CHECKBOX_ENABLE: + { + // Toggle height clipping. + rct_window* 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 (_clipHeightDisplayType == DISPLAY_TYPE::DISPLAY_RAW) + { + _clipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS; + } + else + { + _clipHeightDisplayType = 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; + } } - _toolActive = false; - _dragging = false; - - return window; -} - -static void window_view_clipping_close() -{ - // Turn off view clipping when the window is closed. - rct_window* mainWindow = window_get_main(); - if (mainWindow != nullptr) + void OnMouseDown(rct_widgetindex widgetIndex) override { - mainWindow->viewport->flags &= ~VIEWPORT_FLAG_CLIP_VIEW; - mainWindow->Invalidate(); + 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; + } } -} -static void window_view_clipping_close_button(rct_window* w) -{ - window_view_clipping_close(); -} - -// 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; -} - -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) + void OnUpdate() override { - case WIDX_CLOSE: - window_close(w); - break; - case WIDX_CLIP_CHECKBOX_ENABLE: - // Toggle height clipping. - mainWindow = window_get_main(); + 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 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->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; + // 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); } -} -static void window_view_clipping_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) -{ - rct_window* mainWindow = window_get_main(); - - switch (widgetIndex) + void OnToolUpdate(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) override { - 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; + 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; + } } -} -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) + void OnToolDown(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) override { - gClipHeight = clip_height; + 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) override + { + 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&) override + { + gClipSelectionA = gMapSelectPositionA; + gClipSelectionB = gMapSelectPositionB; + _toolActive = false; + tool_cancel(); + gfx_invalidate_screen(); + } + + void OnPrepareDraw() override + { + WidgetScrollUpdateThumbs(this, WIDX_CLIP_HEIGHT_SLIDER); - // Update the main window accordingly. 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 OnDraw(rct_drawpixelinfo& dpi) override + { + WindowDrawWidgets(this, &dpi); + + // Clip height value + auto screenCoords = this->windowPos + ScreenCoordsXY{ 8, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; + DrawTextBasic(&dpi, screenCoords, STR_VIEW_CLIPPING_HEIGHT_VALUE, {}, { this->colours[0] }); + + screenCoords = this->windowPos + + ScreenCoordsXY{ this->widgets[WIDX_CLIP_HEIGHT_VALUE].left + 1, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; + + switch (_clipHeightDisplayType) + { + case DISPLAY_TYPE::DISPLAY_RAW: + default: + { + auto ft = Formatter(); + ft.Add(static_cast(gClipHeight)); + + // Printing the raw value. + DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); + break; + } + case DISPLAY_TYPE::DISPLAY_UNITS: + { + // Print the value in the configured height label type: + if (gConfigGeneral.show_height_as_units) + { + // 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 + { + return { 1000, 0 }; + } + + void OnOpen() override + { + 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); + + _clipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS; + + // 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(); } } - // Restore previous selection if the tool has been interrupted - if (_toolActive && !window_view_clipping_tool_is_active()) +private: + void OnClose() override { - _toolActive = false; - gClipSelectionA = _previousClipSelectionA; - gClipSelectionB = _previousClipSelectionB; + // 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(); + } } - widget_invalidate(w, WIDX_CLIP_HEIGHT_SLIDER); -} + void SetClipHeight(const uint8_t clipHeight) + { + gClipHeight = clipHeight; + const auto& widget = widgets[WIDX_CLIP_HEIGHT_SLIDER]; + const float clip_height_ratio = static_cast(gClipHeight) / 255; + this->scrolls[0].h_left = static_cast( + std::ceil(clip_height_ratio * (this->scrolls[0].h_right - (widget.width() - 1)))); + } -static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) + 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() { - if (_dragging) + auto* window = window_bring_to_front_by_class(WC_VIEW_CLIPPING); + if (window == nullptr) { - return; - } - - int32_t direction; - auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction); - if (mapCoords) - { - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - map_invalidate_tile_full(gMapSelectPositionA); - gMapSelectPositionA = gMapSelectPositionB = *mapCoords; - map_invalidate_tile_full(*mapCoords); - gMapSelectType = MAP_SELECT_TYPE_FULL; + window = WindowCreate(WC_VIEW_CLIPPING, ScreenCoordsXY(32, 32), WW, WH); } -} - -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) - { - _dragging = true; - _selectionStart = *mapCoords; - } -} - -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(); - } -} - -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(); -} - -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); - } -} - -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 }; - - 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. - 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)); - DrawTextBasic( - dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, &clipHeightValueInUnits, - { 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: - 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] }); - 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] }); - break; - } - } - } -} - -static void window_view_clipping_scrollgetsize(rct_window* w, int scrollIndex, int* width, int* height) -{ - *width = 1000; + return window; } diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index ea481aedd9..a78d2f8b7a 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 - { WIDGETS_END }, + 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, Focus(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ())); + 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; } diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 3c42cdd7ac..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 @@ -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 @@ -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)) @@ -156,16 +156,20 @@ 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) { - 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) + if (gWaterToolLowerCost != MONEY64_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 }); } } } @@ -173,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 7d6d074207..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; @@ -47,14 +47,13 @@ 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(); 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(); @@ -155,16 +154,16 @@ 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, 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/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) 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.cpp b/src/openrct2/CmdlineSprite.cpp index 8d44a95546..78bbe21145 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); @@ -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; @@ -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) { @@ -545,7 +549,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); @@ -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/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/Context.cpp b/src/openrct2/Context.cpp index 6ac59f67a2..6f8cbfb6df 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" @@ -53,6 +54,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" @@ -108,6 +110,9 @@ namespace OpenRCT2 #ifdef ENABLE_SCRIPTING ScriptEngine _scriptEngine; #endif +#ifndef DISABLE_NETWORK + NetworkBase _network; +#endif // Game states std::unique_ptr _titleScreen; @@ -149,6 +154,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 +172,9 @@ namespace OpenRCT2 // If objects use GetContext() in their destructor things won't go well. GameActions::ClearQueue(); - network_close(); +#ifndef DISABLE_NETWORK + _network.Close(); +#endif window_close_all(); // Unload objects after closing all windows, this is to overcome windows like @@ -256,11 +266,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()) @@ -395,6 +412,7 @@ namespace OpenRCT2 } _env->SetBasePath(DIRBASE::RCT2, rct2InstallPath); } + TrackMetaData::Init(); _objectRepository = CreateObjectRepository(_env); _objectManager = CreateObjectManager(*_objectRepository); @@ -463,7 +481,6 @@ namespace OpenRCT2 gGameSoundsOff = !gConfigSound.master_sound_enabled; } - network_set_env(_env); chat_init(); CopyOriginalUserFilesOver(); @@ -478,7 +495,7 @@ namespace OpenRCT2 #endif } - gScenarioTicks = 0; + gCurrentTicks = 0; input_reset_place_obj_modifier(); viewport_init_all(); @@ -524,7 +541,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) { @@ -571,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) { @@ -627,7 +642,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; @@ -638,40 +653,51 @@ namespace OpenRCT2 gScreenAge = 0; gLastAutoSaveUpdate = AUTOSAVE_PAUSE; +#ifndef DISABLE_NETWORK bool sendMap = false; +#endif if (info.Type == FILE_TYPE::SAVED_GAME) { - if (network_get_mode() == NETWORK_MODE_CLIENT) +#ifndef DISABLE_NETWORK + if (_network.GetMode() == NETWORK_MODE_CLIENT) { - network_close(); + _network.Close(); } +#endif game_load_init(); - if (network_get_mode() == NETWORK_MODE_SERVER) +#ifndef DISABLE_NETWORK + if (_network.GetMode() == NETWORK_MODE_SERVER) { sendMap = true; } +#endif } else { scenario_begin(); - if (network_get_mode() == NETWORK_MODE_SERVER) +#ifndef DISABLE_NETWORK + 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(); } +#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_send_map(); + _network.Server_Send_MAP(); } +#endif + #ifdef USE_BREAKPAD - if (network_get_mode() == NETWORK_MODE_NONE) + if (_network.GetMode() == NETWORK_MODE_NONE) { start_silent_record(); } @@ -689,7 +715,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(); @@ -871,13 +897,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 @@ -907,7 +933,7 @@ namespace OpenRCT2 { gNetworkStartPort = gConfigNetwork.default_port; } - network_begin_client(gNetworkStartHost, gNetworkStartPort); + _network.BeginClient(gNetworkStartHost, gNetworkStartPort); } #endif // DISABLE_NETWORK @@ -1128,6 +1154,7 @@ namespace OpenRCT2 DIRID::SEQUENCE, DIRID::REPLAY, DIRID::LOG_DESYNCS, + DIRID::CRASH, }); } @@ -1505,11 +1532,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/Context.h b/src/openrct2/Context.h index 967ac662b7..c8fafaf058 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; @@ -114,10 +116,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; @@ -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; @@ -156,11 +160,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/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/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.cpp b/src/openrct2/Editor.cpp index fb778c1453..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" @@ -47,6 +48,8 @@ using namespace OpenRCT2; +EditorStep gEditorStep; + namespace Editor { static std::array, EnumValue(ObjectType::Count)> _editorSelectedObjectFlags; @@ -61,15 +64,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(); } @@ -84,9 +90,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 +136,15 @@ 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); + // Clear the scenario completion status + gParkFlags &= ~PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT; + gScenarioCompletedCompanyValue = MONEY64_UNDEFINED; + 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 +166,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 +187,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 +246,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 +260,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 +289,7 @@ namespace Editor ClearMapForEditing(loadedFromSave); - gS6Info.editor_step = EditorStep::LandscapeEditor; + gEditorStep = EditorStep::LandscapeEditor; gScreenAge = 0; gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR; viewport_init_all(); @@ -297,16 +301,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(); @@ -354,12 +349,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); } @@ -380,15 +375,15 @@ namespace Editor return; } - switch (gS6Info.editor_step) + 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; } @@ -401,7 +396,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; } @@ -409,7 +404,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; } @@ -417,7 +412,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/Editor.h b/src/openrct2/Editor.h index cc617791b0..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" @@ -44,6 +43,6 @@ enum class EditorStep : uint8_t Invalid = 255, // 255 }; -void editor_open_windows_for_current_step(); +extern EditorStep gEditorStep; -#endif +void editor_open_windows_for_current_step(); diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index cd13e2f396..5b071e49b2 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; @@ -140,7 +138,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 +162,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; @@ -192,14 +190,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 @@ -263,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)]++; } @@ -306,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; + ResearchRemove(tmp); + } + break; + } + case ObjectType::SceneryGroup: + { + ResearchItem tmp = {}; + tmp.type = Research::EntryType::Scenery; + tmp.entryIndex = entryIndex; + ResearchRemove(tmp); + break; + } + default: + break; } } - else if (entry_type == ObjectType::SceneryGroup) - { - ResearchItem tmp = {}; - tmp.type = Research::EntryType::Scenery; - tmp.entryIndex = entry_index; - research_remove(&tmp); - } } /** @@ -341,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); @@ -372,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)); } } } @@ -387,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)); } } } @@ -398,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()); } } @@ -434,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)]++; @@ -448,14 +446,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(); } } @@ -505,18 +503,20 @@ 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; } - 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) @@ -529,89 +529,75 @@ 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->ObjectEntry.GetType(); - 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(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()); @@ -619,7 +605,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; @@ -628,6 +614,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(); @@ -645,7 +648,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/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/Game.cpp b/src/openrct2/Game.cpp index 50c8afb43f..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" @@ -519,8 +518,6 @@ void game_fix_save_vars() void game_load_init() { - rct_window* mainWindow; - IGameStateSnapshots* snapshots = GetContext()->GetGameStateSnapshots(); snapshots->Reset(); @@ -530,11 +527,10 @@ void game_load_init() { viewport_init_all(); game_create_windows(); - mainWindow = window_get_main(); } else { - mainWindow = window_get_main(); + auto* mainWindow = window_get_main(); window_unfollow_sprite(mainWindow); } @@ -593,7 +589,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/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/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/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 8ba15a0de6..28cc191c11 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -10,7 +10,8 @@ #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" #include "world/Duck.h" @@ -39,6 +40,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 +80,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) @@ -200,13 +223,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); @@ -216,7 +239,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 @@ -253,10 +276,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); } @@ -268,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); @@ -294,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); @@ -317,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); @@ -404,8 +427,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots { COMPARE_FIELD(Vehicle, pad_C6[i]); } - COMPARE_FIELD(Vehicle, var_C8); - COMPARE_FIELD(Vehicle, var_CA); + COMPARE_FIELD(Vehicle, animationState); COMPARE_FIELD(Vehicle, scream_sound_id); COMPARE_FIELD(Vehicle, TrackSubposition); COMPARE_FIELD(Vehicle, num_laps); @@ -723,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/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/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/ParkImporter.h b/src/openrct2/ParkImporter.h index 1edcc8b146..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)) { } @@ -57,9 +59,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); @@ -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/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..0d539a0024 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 @@ -83,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.cpp b/src/openrct2/ReplayManager.cpp index e3022c3190..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); @@ -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(); @@ -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]; @@ -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/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/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/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/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(); diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index c235d5891d..f1b21e63ae 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -18,10 +18,9 @@ using namespace OpenRCT2; -BannerPlaceAction::BannerPlaceAction(const CoordsXYZD& loc, uint8_t bannerType, BannerIndex bannerIndex, uint8_t primaryColour) +BannerPlaceAction::BannerPlaceAction(const CoordsXYZD& loc, ObjectEntryIndex bannerType, colour_t primaryColour) : _loc(loc) , _bannerType(bannerType) - , _bannerIndex(bannerIndex) , _primaryColour(primaryColour) { } @@ -31,7 +30,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 +41,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 @@ -57,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_TILE_ELEMENT_LIMIT_REACHED); } auto pathElement = GetValidPathElement(); @@ -86,26 +84,20 @@ 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_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } 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; + return res; } @@ -121,27 +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); - } - - 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); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } 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 = 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_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } banner->flags = 0; banner->text = {}; @@ -150,13 +136,14 @@ GameActions::Result::Ptr BannerPlaceAction::Execute() const banner->colour = _primaryColour; banner->position = TileCoordsXY(_loc); + res->SetData(BannerPlaceActionResult{ 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..5de3d37e82 100644 --- a/src/openrct2/actions/BannerPlaceAction.h +++ b/src/openrct2/actions/BannerPlaceAction.h @@ -11,17 +11,21 @@ #include "GameAction.h" +struct BannerPlaceActionResult +{ + BannerIndex bannerId = BANNER_INDEX_NULL; +}; + DEFINE_GAME_ACTION(BannerPlaceAction, GameCommand::PlaceBanner, GameActions::Result) { 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, ObjectEntryIndex bannerType, colour_t primaryColour); void AcceptParameters(GameActionParameterVisitor & visitor) override; diff --git a/src/openrct2/actions/BannerRemoveAction.cpp b/src/openrct2/actions/BannerRemoveAction.cpp index 184e6dd362..dad26a1036 100644 --- a/src/openrct2/actions/BannerRemoveAction.cpp +++ b/src/openrct2/actions/BannerRemoveAction.cpp @@ -58,20 +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); } - 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()); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + log_error("Invalid banner index. index = ", bannerIndex); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { - log_error("Invalid banner index. index = ", bannerElement->GetIndex()); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + log_error("Invalid banner index. index = ", bannerIndex); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto* bannerEntry = get_banner_entry(banner->type); @@ -96,20 +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); } - 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()); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + log_error("Invalid banner index. index = ", bannerIndex); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { - log_error("Invalid banner index. index = ", bannerElement->GetIndex()); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + log_error("Invalid banner index. index = ", bannerIndex); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto* bannerEntry = get_banner_entry(banner->type); diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index 108f584224..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,14 +80,15 @@ 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(); - 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, STR_NONE); } 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..393fc3e3ad 100644 --- a/src/openrct2/actions/BannerSetNameAction.cpp +++ b/src/openrct2/actions/BannerSetNameAction.cpp @@ -44,10 +44,11 @@ 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); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + log_warning("Invalid banner id, banner id = %d", _bannerIndex); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, 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_CANT_RENAME_BANNER, 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..a27055f97f 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_CANT_REPAINT_THIS, STR_NONE); + } res->Expenditure = ExpenditureType::Landscaping; auto location = banner->position.ToCoordsXY().ToTileCentre(); @@ -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, 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_NONE); + 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_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } return res; } @@ -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_CANT_REPAINT_THIS, STR_NONE); + } res->Expenditure = ExpenditureType::Landscaping; auto location = banner->position.ToCoordsXY().ToTileCentre(); @@ -111,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, STR_NONE); } switch (_type) @@ -128,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, STR_NONE); } banner->flags &= ~BANNER_FLAG_NO_ENTRY; @@ -143,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, STR_NONE); } auto intent = Intent(INTENT_ACTION_UPDATE_BANNER); 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/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index e866d14dea..bccba7e5a7 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) { @@ -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/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; 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); diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 5b1894b9b8..95e592a88c 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" @@ -25,11 +26,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 +42,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 +57,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 @@ -90,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(); @@ -99,10 +107,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 @@ -143,33 +148,71 @@ GameActions::Result::Ptr FootpathPlaceAction::Execute() const { return ElementInsertExecute(std::move(res)); } - else + return ElementUpdateExecute(tileElement, std::move(res)); +} + +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) { - return ElementUpdateExecute(tileElement, std::move(res)); + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + return false; + } + + return pathElement->GetSurfaceEntryIndex() == _type && pathElement->GetRailingsEntryIndex() == _railingsType; } + + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + return pathElement->GetLegacyPathEntryIndex() == _type; + } + + return false; +} + +bool FootpathPlaceAction::IsSameAsEntranceElement(const EntranceElement& entranceElement) const +{ + if (entranceElement.HasLegacyPathEntry()) + { + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + return entranceElement.GetLegacyPathEntryIndex() == _type; + } + + return false; + } + + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + return false; + } + + 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->GetSurfaceEntryIndex() != newFootpathType || pathElement->IsQueue() != newPathIsQueue) + if (!IsSameAsPathElement(pathElement)) { res->Cost += MONEY(6, 00); } 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; } 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->GetSurfaceEntryIndex() != newFootpathType || pathElement->IsQueue() != newPathIsQueue) + if (!IsSameAsPathElement(pathElement)) { res->Cost += MONEY(6, 00); } @@ -181,14 +224,22 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementUpdateExecute(PathElement* footpath_remove_edges_at(_loc, reinterpret_cast(pathElement)); } - pathElement->SetSurfaceEntryIndex(_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) @@ -218,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); @@ -238,16 +289,16 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertQuery(GameActions::Re { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetPathType() == (_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) @@ -257,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); } @@ -266,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); @@ -304,16 +357,16 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertExecute(GameActions:: { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetPathType() == (_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); @@ -324,12 +377,13 @@ 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) { - 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); @@ -338,8 +392,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->SetPathType(_type & 0x7F); + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + entranceElement->SetLegacyPathEntryIndex(_type); + } + else + { + entranceElement->SetSurfaceEntryIndex(_type); + } map_invalidate_tile_full(_loc); } } @@ -349,10 +409,18 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertExecute(GameActions:: Guard::Assert(pathElement != nullptr); pathElement->SetClearanceZ(zHigh); - pathElement->SetSurfaceEntryIndex(_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); @@ -390,10 +458,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/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 80249c155f..f065357607 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" @@ -22,11 +23,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 +38,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 @@ -102,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); @@ -122,16 +129,16 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertQuery(GameAc { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetPathType() == (_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) @@ -140,9 +147,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); @@ -151,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); @@ -189,16 +198,16 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertExecute(Game { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetPathType() == (_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); @@ -208,12 +217,14 @@ 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) { - 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,8 +233,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->SetPathType(_type & 0x7F); + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + entranceElement->SetLegacyPathEntryIndex(_type); + } + else + { + entranceElement->SetSurfaceEntryIndex(_type); + } map_invalidate_tile_full(_loc); } } @@ -233,10 +250,18 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertExecute(Game Guard::Assert(pathElement != nullptr); pathElement->SetClearanceZ(zHigh); - pathElement->SetSurfaceEntryIndex(_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 +279,23 @@ 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; + } + + return false; + } + + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + return false; + } + + 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/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index a68db18e53..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); @@ -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 adc8606a62..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; @@ -335,7 +286,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"; } @@ -492,7 +443,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); } @@ -502,7 +453,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/GameAction.h b/src/openrct2/actions/GameAction.h index 04ac4b2b36..474d8fbf84 100644 --- a/src/openrct2/actions/GameAction.h +++ b/src/openrct2/actions/GameAction.h @@ -12,102 +12,16 @@ #include "../Game.h" #include "../common.h" #include "../core/DataSerialiser.h" -#include "../core/IStream.hpp" #include "../localisation/StringIds.h" -#include "../world/Map.h" +#include "GameActionResult.h" #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; @@ -115,41 +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; - - 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; - }; - - 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/GameActionCompat.cpp b/src/openrct2/actions/GameActionCompat.cpp index 9af73acc63..6aebf1433c 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); }); @@ -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/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/actions/GameActionResult.cpp b/src/openrct2/actions/GameActionResult.cpp new file mode 100644 index 0000000000..f24d674a4f --- /dev/null +++ b/src/openrct2/actions/GameActionResult.cpp @@ -0,0 +1,42 @@ +#include "GameActionResult.h" + +#include "../localisation/Localisation.h" + +namespace GameActions +{ + Result::Result(GameActions::Status error, rct_string_id title, rct_string_id message, uint8_t* args /*= nullptr*/) + { + Error = error; + ErrorTitle = title; + ErrorMessage = message; + if (args != nullptr) + { + 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 + { + return std::visit(StringVariantVisitor{ ErrorMessageArgs.data() }, ErrorTitle); + } + + std::string GameActions::Result::GetErrorMessage() const + { + return std::visit(StringVariantVisitor{ ErrorMessageArgs.data() }, ErrorMessage); + } + +} // namespace GameActions diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h new file mode 100644 index 0000000000..41a4410003 --- /dev/null +++ b/src/openrct2/actions/GameActionResult.h @@ -0,0 +1,100 @@ +/***************************************************************************** + * 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 +#include + +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 final + { + public: + using Ptr = std::unique_ptr; + using StringVariant = std::variant; + + GameActions::Status Error = GameActions::Status::Ok; + StringVariant ErrorTitle = STR_NONE; + StringVariant ErrorMessage = STR_NONE; + 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 title, rct_string_id message, uint8_t* args = nullptr); + + 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 + +} // namespace GameActions 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; diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index 8142c97462..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)) @@ -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/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/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/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index 53cbb4b901..bf6f66428e 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 }; @@ -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 diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index 05c33c6045..5a39145123 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 }; @@ -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 diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index 43144fcfe0..8031b818e1 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" @@ -48,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); } } @@ -74,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; } @@ -88,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. @@ -102,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; } @@ -130,15 +132,14 @@ 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); 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)); @@ -183,7 +184,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; } @@ -198,7 +199,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; } @@ -221,7 +223,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/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 3510399c91..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" @@ -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/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index 656949a681..f42cdf8c4e 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) @@ -616,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), STR_NONE); } // switch selectionType // Raise / lower the land tool selection area 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/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index 84d7fb8de2..f4c7818f55 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -14,29 +14,10 @@ #include "../object/ObjectLimits.h" #include "../ride/Ride.h" #include "../world/Banner.h" +#include "../world/ConstructionClearance.h" #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) @@ -44,14 +25,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 +33,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,19 +44,20 @@ 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 { - 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; @@ -100,20 +66,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); @@ -128,17 +94,11 @@ 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_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } } @@ -166,50 +126,53 @@ 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 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; @@ -217,7 +180,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; @@ -225,13 +189,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); @@ -243,6 +207,35 @@ 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_CANT_POSITION_THIS_HERE, 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; + } + + resultData.bannerId = banner->id; + } + uint8_t tileNum = 0; for (rct_large_scenery_tile* tile = sceneryEntry->tiles; tile->x_offset != -1; tile++, tileNum++) { @@ -261,12 +254,18 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const isTree); if (canBuild->Error != GameActions::Status::Ok) { + if (banner != nullptr) + { + DeleteBanner(banner->id); + } canBuild->ErrorTitle = STR_CANT_POSITION_THIS_HERE; return canBuild; } supportsCost += canBuild->Cost; - res->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)) { @@ -283,43 +282,17 @@ 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); if (tileNum == 0) { - res->firstTileHeight = zLow; - } - } - - // 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; + resultData.firstTileHeight = zLow; } } @@ -327,6 +300,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; } @@ -403,11 +378,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..2925be57f5 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.h +++ b/src/openrct2/actions/LargeSceneryPlaceAction.h @@ -13,26 +13,20 @@ #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; 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/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(); diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index 794d863794..7c5d82f0ae 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -53,22 +53,22 @@ 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); + 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) { diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index aa394ea0ea..2515746381 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -11,6 +11,9 @@ #include "../management/Finance.h" #include "../ride/RideData.h" #include "../ride/TrackData.h" +#include "../world/ConstructionClearance.h" + +using namespace OpenRCT2::TrackMetaData; MazePlaceTrackAction::MazePlaceTrackAction(const CoordsXYZ& location, NetworkRideId_t rideIndex, uint16_t mazeEntry) : _loc(location) @@ -91,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; @@ -113,7 +117,8 @@ GameActions::Result::Ptr MazePlaceTrackAction::Query() const return res; } - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16)); + const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Price) >> 16)); res->Cost = canBuild->Cost + price / 2 * 10; return res; @@ -154,7 +159,8 @@ GameActions::Result::Ptr MazePlaceTrackAction::Execute() const return canBuild; } - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16)); + const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Price) >> 16)); res->Cost = canBuild->Cost + price / 2 * 10; auto startLoc = _loc.ToTileStart(); @@ -164,6 +170,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 d2755adb1c..c9376787e0 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -18,9 +18,12 @@ #include "../ride/RideData.h" #include "../ride/Track.h" #include "../ride/TrackData.h" +#include "../world/ConstructionClearance.h" #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) @@ -107,19 +110,19 @@ 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) + 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; @@ -134,7 +137,8 @@ GameActions::Result::Ptr MazeSetTrackAction::Query() const return res; } - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16)); + const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Price) >> 16)); res->Cost = price / 2 * 10; return res; @@ -169,7 +173,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& ted = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Price) >> 16)); res->Cost = price / 2 * 10; auto startLoc = _loc.ToTileStart(); @@ -179,6 +184,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); @@ -289,7 +295,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/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; diff --git a/src/openrct2/actions/ParkMarketingAction.cpp b/src/openrct2/actions/ParkMarketingAction.cpp index aa9c2abda4..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) { @@ -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/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(); 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(); 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/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(); } diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index bee844a0e0..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)) + 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(); @@ -61,13 +61,13 @@ 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); + return MakeResult(GameActions::Status::Disallowed, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } Peep* existing = network_get_pickup_peep(_owner); - if (existing) + if (existing != nullptr) { // already picking up a peep PeepPickupAction existingPickupAction{ @@ -83,13 +83,13 @@ 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; 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(); @@ -119,10 +119,10 @@ 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) + if (existing != nullptr) { // already picking up a peep PeepPickupAction existingPickupAction{ @@ -148,10 +148,10 @@ 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) + if (pickedUpPeep != nullptr) { pickedUpPeep->PickupAbort(_loc.x); } @@ -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; } diff --git a/src/openrct2/actions/PlaceParkEntranceAction.cpp b/src/openrct2/actions/PlaceParkEntranceAction.cpp index 248353afee..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" @@ -50,8 +51,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); @@ -59,7 +60,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) @@ -85,9 +87,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 @@ -145,7 +146,14 @@ GameActions::Result::Ptr PlaceParkEntranceAction::Execute() const entranceElement->SetDirection(_loc.direction); entranceElement->SetSequenceIndex(index); entranceElement->SetEntranceType(ENTRANCE_TYPE_PARK_ENTRANCE); - entranceElement->SetPathType(_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/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/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index df9fa87135..36e0341c11 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" @@ -25,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) @@ -79,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 @@ -122,28 +117,24 @@ 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; 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; @@ -167,16 +158,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 +193,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 +245,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) @@ -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; @@ -298,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/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index a63dbc7ab2..cab6435f44 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" @@ -117,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 @@ -128,105 +129,18 @@ 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); - 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 = {}; - } - } + const auto rideId = ride->id; + News::DisableNewsItems(News::ItemType::Ride, EnumValue(rideId)); + UnlinkAllBannersForRide(ride->id); + + RideUse::GetHistory().RemoveValue(ride->id); 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(ride->id); } MarketingCancelCampaignsForRide(_rideIndex); @@ -235,7 +149,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) }; @@ -245,12 +159,9 @@ 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, _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 @@ -357,13 +268,13 @@ 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) }; } - window_close_by_number(WC_DEMOLISH_RIDE_PROMPT, _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 df2b87bf2c..bc1e02377d 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( @@ -48,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", static_cast(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, errorTitle); + log_warning("Invalid game command for ride %d", EnumValue(_rideIndex)); + 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) @@ -76,7 +77,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()); @@ -84,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; } } @@ -91,12 +93,12 @@ 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_LAND_NOT_OWNED_BY_PARK); } 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( @@ -107,7 +109,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); } @@ -127,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", static_cast(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, errorTitle); + log_warning("Invalid game command for ride %d", EnumValue(_rideIndex)); + return MakeResult(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); } if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) @@ -143,7 +146,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()); @@ -151,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; } } @@ -215,17 +219,17 @@ 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)) { - return MakeResult(GameActions::Status::NotOwned, errorTitle); + return MakeResult(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); } 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); @@ -236,7 +240,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/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index f4fac8cae3..98691e9062 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -74,23 +74,23 @@ 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)); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + log_warning("Invalid ride id %d for entrance/exit removal", EnumValue(_rideIndex)); + 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( @@ -99,9 +99,9 @@ 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); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + "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, STR_NONE); } return MakeResult(); @@ -112,8 +112,8 @@ 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)); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + log_warning("Invalid ride id %d for entrance/exit removal", EnumValue(_rideIndex)); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } const bool isGhost = GetFlags() & GAME_COMMAND_FLAG_GHOST; @@ -130,9 +130,9 @@ 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); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + "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, STR_NONE); } auto res = MakeResult(); diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index d17ad76035..4cf798a188 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) @@ -54,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) @@ -65,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: @@ -74,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: @@ -82,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(); @@ -94,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) @@ -138,10 +139,10 @@ GameActions::Result::Ptr RideSetAppearanceAction::Execute() const gfx_invalidate_screen(); break; } - window_invalidate_by_number(WC_RIDE, _rideIndex); + window_invalidate_by_number(WC_RIDE, EnumValue(_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/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/actions/RideSetColourSchemeAction.cpp b/src/openrct2/actions/RideSetColourSchemeAction.cpp index 8e245cc3df..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(); } @@ -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/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index 374bd4d9a0..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,17 +77,17 @@ 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()) + if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); res->Position = { location, tile_element_height(location) }; @@ -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, EnumValue(ride.id)); } } } diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index fb7b8d506b..70dee20575 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -45,8 +45,8 @@ GameActions::Result::Ptr RideSetSettingAction::Query() const auto ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride: #%d.", static_cast(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + log_warning("Invalid ride: #%d.", EnumValue(_rideIndex)); + 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(); @@ -153,8 +154,8 @@ GameActions::Result::Ptr RideSetSettingAction::Execute() const auto ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride: #%d.", static_cast(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + log_warning("Invalid ride: #%d.", EnumValue(_rideIndex)); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } switch (_setting) @@ -223,17 +224,18 @@ GameActions::Result::Ptr RideSetSettingAction::Execute() const break; case RideSetSetting::RideType: ride->type = _value; + ride->UpdateRideTypeForAllPieces(); gfx_invalidate_screen(); break; } 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) }; } - window_invalidate_by_number(WC_RIDE, _rideIndex); + window_invalidate_by_number(WC_RIDE, EnumValue(_rideIndex)); return res; } @@ -291,9 +293,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 2750d639f3..6ed78ec399 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; @@ -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)) { @@ -131,7 +132,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) }; @@ -154,7 +155,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, EnumValue(_rideIndex)); break; case RideStatus::Simulating: { @@ -176,7 +177,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, EnumValue(_rideIndex)); break; } case RideStatus::Testing: @@ -195,7 +196,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, EnumValue(_rideIndex)); if (constructionWindow != nullptr) { window_close(constructionWindow); @@ -223,7 +224,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, EnumValue(_rideIndex)); break; } default: diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 167d2cb0b2..a82575f86b 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) @@ -68,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) @@ -92,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 @@ -106,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(); @@ -126,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) @@ -149,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) @@ -171,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); @@ -185,21 +187,21 @@ 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; 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) }; } auto intent = Intent(INTENT_ACTION_RIDE_PAINT_RESET_VEHICLE); - intent.putExtra(INTENT_EXTRA_RIDE_ID, _rideIndex); + intent.putExtra(INTENT_EXTRA_RIDE_ID, EnumValue(_rideIndex)); context_broadcast_intent(&intent); gfx_invalidate_screen(); diff --git a/src/openrct2/actions/ScenarioSetSettingAction.cpp b/src/openrct2/actions/ScenarioSetSettingAction.cpp index 6bd4291e86..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(); @@ -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); @@ -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(); diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index ee749f9911..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" @@ -68,18 +69,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 +243,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; } @@ -683,7 +684,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/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(); } diff --git a/src/openrct2/actions/SignSetNameAction.cpp b/src/openrct2/actions/SignSetNameAction.cpp index e58b2ffc52..92b9145ab7 100644 --- a/src/openrct2/actions/SignSetNameAction.cpp +++ b/src/openrct2/actions/SignSetNameAction.cpp @@ -45,10 +45,11 @@ 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); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE); } return MakeResult(); } @@ -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_CANT_RENAME_SIGN, STR_NONE); + } if (!_name.empty()) { diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index eb2e0525c7..7f36bcee82 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -39,10 +39,11 @@ 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); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + log_error("Invalid banner id. id = ", _bannerIndex); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (_isLarge) @@ -51,22 +52,22 @@ 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, 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_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } } else { 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_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, 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_CANT_REPAINT_THIS, STR_NONE); + } CoordsXY coords = banner->position.ToCoordsXY(); @@ -86,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, STR_NONE); } } else diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index 5aaeabc114..bc6dfec98e 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" @@ -27,26 +28,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 +81,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,31 +94,30 @@ 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 (!byte_9D8150 && (_loc.x > gMapSizeMaxXY || _loc.y > gMapSizeMaxXY)) + 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; - 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 +125,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(); } @@ -177,7 +157,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); @@ -187,38 +167,34 @@ 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); } } - if (!gCheatsDisableClearanceChecks && !(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_STACKABLE))) + if (!gCheatsDisableClearanceChecks && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE))) { 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); } } } - 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); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, 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) { @@ -226,15 +202,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); } } @@ -242,17 +216,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 +249,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) @@ -285,7 +258,9 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const return canBuild; } - res->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; res->Cost = (sceneryEntry->price * 10) + canBuild->Cost; @@ -309,7 +284,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; @@ -323,15 +298,14 @@ 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; - 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 +314,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 +343,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 +353,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 +386,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); @@ -423,14 +396,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); @@ -445,10 +419,13 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const sceneryElement->SetNeedsSupports(); } - res->tileElement = sceneryElement->as(); + 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() }); 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/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; diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.cpp b/src/openrct2/actions/SmallSceneryRemoveAction.cpp index e7fcb83290..f145ca596f 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; @@ -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; 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())) diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index f8138d93a8..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) @@ -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,9 +53,11 @@ 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); + // Due to patrol areas best to invalidate the whole screen on removal of staff + gfx_invalidate_screen(); return MakeResult(); } diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index e2ca9cd4b7..b3a63a128d 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -26,15 +26,13 @@ #include "../world/Park.h" #include "../world/Sprite.h" -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) -{ -} +/* rct2: 0x009929FC */ +static constexpr const PeepSpriteType spriteTypes[] = { + PeepSpriteType::Handyman, + PeepSpriteType::Mechanic, + PeepSpriteType::Security, + PeepSpriteType::EntertainerPanda, +}; StaffHireNewAction::StaffHireNewAction( bool autoPosition, StaffType staffType, EntertainerCostume entertainerType, uint32_t staffOrders) @@ -77,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)) @@ -86,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)) @@ -101,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(); @@ -110,35 +107,30 @@ 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); } } - // 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_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 { @@ -203,7 +195,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 @@ -222,16 +215,9 @@ GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const newPeep->EnergyTarget = 0x60; newPeep->StaffMowingTimeout = 0; - newPeep->StaffId = staffIndex; + newPeep->PatrolInfo = nullptr; - gStaffModes[staffIndex] = StaffMode::Walk; - - for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) - { - gStaffPatrolAreas[staffIndex * STAFF_PATROL_AREA_SIZE + i] = 0; - } - - res->peepSriteIndex = newPeep->sprite_index; + res->SetData(StaffHireNewActionResult{ newPeep->sprite_index }); } return res; @@ -285,17 +271,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 +297,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/StaffHireNewAction.h b/src/openrct2/actions/StaffHireNewAction.h index 47c9d6bb4c..5b06979fa6 100644 --- a/src/openrct2/actions/StaffHireNewAction.h +++ b/src/openrct2/actions/StaffHireNewAction.h @@ -12,24 +12,12 @@ #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 +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/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 diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index 6f475563b5..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); @@ -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..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)) @@ -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..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; @@ -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/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index 8f981a9468..49231c99f0 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 @@ -36,63 +37,66 @@ 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(); } +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(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); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } - int32_t patrolOffset = staff->StaffId * STAFF_PATROL_AREA_SIZE; - - staff_toggle_patrol_area(staff->StaffId, _loc); - - bool isPatrolling = false; - for (int32_t i = 0; i < 128; i++) + switch (_mode) { - if (gStaffPatrolAreas[patrolOffset + i]) - { - isPatrolling = true; + case StaffSetPatrolAreaMode::Set: + staff->SetPatrolArea(_loc, true); + InvalidatePatrolTile(_loc); + break; + case StaffSetPatrolAreaMode::Unset: + staff->SetPatrolArea(_loc, false); + if (!staff->HasPatrolArea()) + { + staff->ClearPatrolArea(); + } + InvalidatePatrolTile(_loc); + break; + case StaffSetPatrolAreaMode::ClearAll: + staff->ClearPatrolArea(); + gfx_invalidate_screen(); break; - } } - if (isPatrolling) - { - gStaffModes[staff->StaffId] = StaffMode::Patrol; - } - else if (gStaffModes[staff->StaffId] == StaffMode::Patrol) - { - gStaffModes[staff->StaffId] = StaffMode::Walk; - } - - 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 }); - } - } 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/actions/SurfaceSetStyleAction.cpp b/src/openrct2/actions/SurfaceSetStyleAction.cpp index 7847228cd1..ed902ba9ab 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 }; @@ -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); } } @@ -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/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/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index e72f07d692..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,39 +63,36 @@ 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); } - 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 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) { 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; @@ -135,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; } @@ -149,36 +128,33 @@ 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 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) { 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; @@ -216,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) @@ -275,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; diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 4858dff29e..8f5a6eb1cd 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -9,35 +9,19 @@ #include "TrackPlaceAction.h" +#include "../core/Numerics.hpp" #include "../management/Finance.h" #include "../ride/RideData.h" #include "../ride/Track.h" #include "../ride/TrackData.h" #include "../ride/TrackDesign.h" -#include "../util/Util.h" +#include "../util/Math.hpp" +#include "../world/ConstructionClearance.h" #include "../world/MapAnimation.h" #include "../world/Surface.h" #include "RideSetSettingAction.h" -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) -{ -} +using namespace OpenRCT2::TrackMetaData; TrackPlaceAction::TrackPlaceAction( NetworkRideId_t rideIndex, int32_t trackType, const CoordsXYZD& origin, int32_t brakeSpeed, int32_t colour, @@ -84,43 +68,45 @@ 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)); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + log_warning("Invalid ride for track placement, rideIndex = %d", EnumValue(_rideIndex)); + 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", static_cast(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + log_warning("Invalid ride subtype for track placement, rideIndex = %d", EnumValue(_rideIndex)); + 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); } } @@ -130,31 +116,37 @@ 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. 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& 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); } } } money32 cost = 0; - const rct_preview_track* trackBlock = TrackBlocks[_trackType]; + 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++) @@ -164,7 +156,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++; } @@ -172,30 +165,35 @@ 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) { - if (TrackFlags[_trackType] & TRACK_ELEM_FLAG_STARTS_AT_HALF_HEIGHT) + if (ted.Flags & TRACK_ELEM_FLAG_STARTS_AT_HALF_HEIGHT) { 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); } } } // If that is not the case, then perform the remaining checks - trackBlock = TrackBlocks[_trackType]; + trackBlock = ted.Block; for (int32_t blockIndex = 0; trackBlock->index != 0xFF; trackBlock++, blockIndex++) { @@ -205,7 +203,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); @@ -225,7 +224,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) @@ -251,56 +251,64 @@ 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) + 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 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; - - if (TrackFlags[_trackType] & TRACK_ELEM_FLAG_ONLY_ABOVE_GROUND) + 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); } } - if (TrackFlags[_trackType] & TRACK_ELEM_FLAG_ONLY_UNDERWATER) + 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 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) + if (clearanceData.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) && !byte_9D8150) + 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()) @@ -309,25 +317,29 @@ 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); } } } - int32_t entranceDirections = TrackSequenceProperties[_trackType][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)) { - 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) { @@ -347,9 +359,11 @@ 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); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_TOO_HIGH_FOR_SUPPORTS); } } } @@ -364,10 +378,12 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= TrackPricing[_trackType]; + price *= ted.Price; price >>= 16; res->Cost = cost + ((price / 2) * 10); + res->SetData(std::move(resultData)); + return res; } @@ -376,34 +392,32 @@ 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)); - return std::make_unique(GameActions::Status::InvalidParameters); + log_warning("Invalid ride for track placement, rideIndex = %d", EnumValue(_rideIndex)); + 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", static_cast(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters); + log_warning("Invalid ride subtype for track placement, rideIndex = %d", EnumValue(_rideIndex)); + 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; - const uint8_t(*wallEdges)[16]; - wallEdges = &TrackSequenceElementAllowedWallEdges[_trackType]; + const auto& ted = GetTrackElementDescriptor(_trackType); + const auto& wallEdges = ted.SequenceElementAllowedWallEdges; money32 cost = 0; - const rct_preview_track* trackBlock = TrackBlocks[_trackType]; - - trackBlock = TrackBlocks[_trackType]; + 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 }; @@ -450,9 +464,9 @@ 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); + intersectingDirections = Numerics::rol4(intersectingDirections, _origin.direction); for (int32_t i = 0; i < NumOrthogonalDirections; i++) { if (intersectingDirections & (1 << i)) @@ -463,19 +477,23 @@ 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) + 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 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) @@ -533,15 +551,15 @@ 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)) { - entranceDirections = TrackSequenceProperties[_trackType][0]; + entranceDirections = ted.SequenceProperties[0]; } } - if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN || ride->overall_view.isNull()) + if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN || ride->overall_view.IsNull()) { ride->overall_view = mapLoc; } @@ -549,8 +567,10 @@ 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)); - return std::make_unique(GameActions::Status::NoFreeElements); + log_warning("Cannot create track element for ride = %d", EnumValue(_rideIndex)); + return MakeResult( + GameActions::Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_TILE_ELEMENT_LIMIT_REACHED); } trackElement->SetClearanceZ(clearanceZ); @@ -559,6 +579,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) @@ -596,7 +617,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } trackElement->SetColourScheme(_colour); - entranceDirections = TrackSequenceProperties[_trackType][0]; + entranceDirections = ted.SequenceProperties[0]; if (entranceDirections & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH) { uint8_t availableDirections = entranceDirections & 0x0F; @@ -628,7 +649,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(); } @@ -652,16 +673,19 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= TrackPricing[_trackType]; + price *= ted.Price; price >>= 16; res->Cost = cost + ((price / 2) * 10); + res->SetData(std::move(resultData)); + return res; } bool TrackPlaceAction::CheckMapCapacity(int16_t numTiles) const { - for (const rct_preview_track* trackBlock = TrackBlocks[_trackType]; 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/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/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 0165bb721f..d155087b76 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) @@ -109,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()) @@ -120,21 +122,22 @@ 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) { 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 rct_preview_track* trackBlock = TrackBlocks[trackType]; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = ted.Block; trackBlock += tileElement->AsTrack()->GetSequenceIndex(); auto startLoc = _origin; @@ -150,7 +153,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const money32 cost = 0; - trackBlock = TrackBlocks[trackType]; + trackBlock = ted.Block; for (; trackBlock->index != 255; trackBlock++) { rotatedTrack = CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(startLoc.direction), trackBlock->z }; @@ -197,10 +200,10 @@ 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 = TrackSequenceProperties[trackType][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)) @@ -213,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; @@ -226,7 +229,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= TrackPricing[trackType]; + price *= ted.Price; price >>= 16; price = (price + cost) / 2; if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) @@ -301,20 +304,21 @@ 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(); - auto trackType = tileElement->AsTrack()->GetTrackType(); + const auto trackType = tileElement->AsTrack()->GetTrackType(); bool isLiftHill = tileElement->AsTrack()->HasChain(); auto ride = get_ride(rideIndex); 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 rct_preview_track* trackBlock = TrackBlocks[trackType]; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = ted.Block; trackBlock += tileElement->AsTrack()->GetSequenceIndex(); auto startLoc = _origin; @@ -329,7 +333,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const res->Position.z = startLoc.z; money32 cost = 0; - trackBlock = TrackBlocks[trackType]; + trackBlock = ted.Block; for (; trackBlock->index != 255; trackBlock++) { rotatedTrackLoc = CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(startLoc.direction), trackBlock->z }; @@ -371,10 +375,10 @@ 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 = TrackSequenceProperties[trackType][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)) @@ -387,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; @@ -422,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(); @@ -473,7 +477,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= TrackPricing[trackType]; + price *= ted.Price; price >>= 16; price = (price + cost) / 2; if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) 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) diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 583db43616..61587af65b 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -14,31 +14,14 @@ #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" #include "../world/Surface.h" #include "../world/Wall.h" -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) -{ -} +using namespace OpenRCT2::TrackMetaData; WallPlaceAction::WallPlaceAction( ObjectEntryIndex wallType, const CoordsXYZ& loc, uint8_t edge, int32_t primaryColour, int32_t secondaryColour, @@ -50,14 +33,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 +43,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,12 +55,12 @@ 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 { - auto res = std::make_unique(); + auto res = MakeResult(); res->ErrorTitle = STR_CANT_BUILD_THIS_HERE; res->Position = _loc; @@ -108,7 +75,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) @@ -117,23 +84,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_LAND_NOT_OWNED_BY_PARK); } } 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_LAND_NOT_OWNED_BY_PARK); } } - else if (!byte_9D8150 && (_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); + 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; @@ -144,7 +111,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(); @@ -161,7 +128,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) @@ -170,13 +137,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))) @@ -188,8 +155,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) @@ -204,8 +171,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; } @@ -218,8 +186,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) @@ -234,8 +202,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); } } } @@ -248,23 +217,15 @@ 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) { - 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_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } } @@ -273,8 +234,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; } @@ -292,16 +252,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; @@ -322,7 +285,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(); @@ -341,7 +304,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; @@ -361,20 +324,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_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } banner->text = {}; @@ -393,7 +350,10 @@ GameActions::Result::Ptr WallPlaceAction::Execute() const } 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); @@ -404,10 +364,7 @@ GameActions::Result::Ptr WallPlaceAction::Execute() const wallElement->SetAcrossTrack(wallAcrossTrack); wallElement->SetEntryIndex(_wallType); - if (_bannerId != BANNER_INDEX_NULL) - { - wallElement->SetBannerIndex(_bannerId); - } + wallElement->SetBannerIndex(banner != nullptr ? banner->id : BANNER_INDEX_NULL); if (wallEntry->flags & WALL_SCENERY_HAS_TERNARY_COLOUR) { @@ -416,12 +373,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; } @@ -433,6 +392,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& ted = GetTrackElementDescriptor(trackType); int32_t sequence = trackElement->GetSequenceIndex(); int32_t direction = (_edge - trackElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK; auto ride = get_ride(trackElement->GetRideIndex()); @@ -465,20 +427,20 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( int32_t z; if (sequence == 0) { - if (TrackSequenceProperties[trackType][0] & TRACK_SEQUENCE_FLAG_DISALLOW_DOORS) + if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_DISALLOW_DOORS) { return false; } - if (TrackDefinitions[trackType].bank_start == 0) + if (ted.Definition.bank_start == 0) { - if (!(TrackCoordinates[trackType].rotation_begin & 4)) + if (!(ted.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; + const rct_preview_track* trackBlock = &ted.Block[sequence]; + z = ted.Coordinates.z_begin; z = trackElement->base_height + ((z - trackBlock->z) * 8); if (z == z0) { @@ -489,31 +451,31 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( } } - const rct_preview_track* trackBlock = &TrackBlocks[trackType][sequence + 1]; + const rct_preview_track* trackBlock = &ted.Block[sequence + 1]; if (trackBlock->index != 0xFF) { return false; } - if (TrackDefinitions[trackType].bank_end != 0) + if (ted.Definition.bank_end != 0) { return false; } - direction = TrackCoordinates[trackType].rotation_end; + direction = ted.Coordinates.rotation_end; if (direction & 4) { return false; } - direction = (trackElement->GetDirection() + TrackCoordinates[trackType].rotation_end) & TILE_ELEMENT_DIRECTION_MASK; + direction = (trackElement->GetDirection() + ted.Coordinates.rotation_end) & TILE_ELEMENT_DIRECTION_MASK; if (direction != _edge) { return false; } - trackBlock = &TrackBlocks[trackType][sequence]; - z = TrackCoordinates[trackType].z_end; + trackBlock = &ted.Block[sequence]; + z = ted.Coordinates.z_end; z = trackElement->base_height + ((z - trackBlock->z) * 8); return z == z0; } @@ -525,13 +487,10 @@ 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)) { - 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); @@ -553,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; } @@ -561,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: @@ -576,24 +535,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 (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_NO_WALLS)) + if (sceneryEntry != nullptr && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS)) { map_obstruction_set_error_text(tileElement, *res); return res; @@ -617,7 +580,8 @@ bool WallPlaceAction::TrackIsAllowedWallEdges( { if (!GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_NO_WALLS)) { - if (TrackSequenceElementAllowedWallEdges[trackType][trackSequence] & (1 << direction)) + const auto& ted = GetTrackElementDescriptor(trackType); + if (ted.SequenceElementAllowedWallEdges[trackSequence] & (1 << direction)) { return true; } diff --git a/src/openrct2/actions/WallPlaceAction.h b/src/openrct2/actions/WallPlaceAction.h index 8a1776395a..9699eeaebf 100644 --- a/src/openrct2/actions/WallPlaceAction.h +++ b/src/openrct2/actions/WallPlaceAction.h @@ -11,21 +11,17 @@ #include "../ride/RideData.h" #include "../ride/TrackData.h" +#include "../world/Banner.h" #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; + 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 }; @@ -34,7 +30,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/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); diff --git a/src/openrct2/actions/WaterLowerAction.cpp b/src/openrct2/actions/WaterLowerAction.cpp index 0403fc2bcc..8946bdec0f 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 }; @@ -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) diff --git a/src/openrct2/actions/WaterRaiseAction.cpp b/src/openrct2/actions/WaterRaiseAction.cpp index 231ef43027..69ec4ae329 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 }; @@ -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) diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index 43d41bfe87..844ed6dae5 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" @@ -67,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(); @@ -85,12 +86,11 @@ 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()) { - 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) @@ -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/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/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/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/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 b074e0b785..f5a3b5c776 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #ifdef USE_BREAKPAD @@ -388,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) @@ -406,7 +403,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/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/common.h b/src/openrct2/common.h index 7b81c78ae6..12c6552dce 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 @@ -20,14 +19,10 @@ #endif #include "Diagnostic.h" -#include "core/Numerics.hpp" #include #include #include -#include - -using namespace Numerics; using utf8 = char; using utf8string = utf8*; @@ -42,39 +37,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) - { - 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 @@ -141,6 +103,27 @@ 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)) + +constexpr money64 ToMoney64(money32 value) +{ + return value == MONEY32_UNDEFINED ? MONEY64_UNDEFINED : value; +} + +constexpr money64 ToMoney64(money16 value) +{ + return value == MONEY16_UNDEFINED ? MONEY64_UNDEFINED : value; +} + +constexpr money32 ToMoney32(money64 value) +{ + return value == MONEY64_UNDEFINED ? MONEY32_UNDEFINED : static_cast(value); +} + +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; @@ -211,5 +194,3 @@ constexpr uint16_t SPRITE_INDEX_NULL = 0xFFFF; #else // PLATFORM_X86 # define FASTCALL #endif // PLATFORM_X86 - -#endif diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index e29069d377..84baec7c5e 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()); @@ -739,7 +737,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); } @@ -1002,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/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/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/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/Crypt.OpenRCT2.cpp b/src/openrct2/core/Crypt.OpenRCT2.cpp new file mode 100644 index 0000000000..ba48bd5d15 --- /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 final : 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 468ca65780..87baf9c751 100644 --- a/src/openrct2/core/Crypt.h +++ b/src/openrct2/core/Crypt.h @@ -48,12 +48,19 @@ namespace Crypt using Sha1Algorithm = HashAlgorithm<20>; using Sha256Algorithm = HashAlgorithm<32>; + using FNV1aAlgorithm = HashAlgorithm<8>; // Factories - std::unique_ptr CreateSHA1(); - std::unique_ptr CreateSHA256(); - std::unique_ptr CreateRSA(); - std::unique_ptr CreateRSAKey(); + [[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) { diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index f4c9266fc5..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" @@ -38,19 +39,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()); @@ -210,39 +215,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.id); - temp = ByteSwapBE(temp); - stream->Write(&temp); - } - static void decode(OpenRCT2::IStream* stream, NetworkRideId_t& val) - { - uint32_t temp; - stream->Read(&temp); - val.id = static_cast(ByteSwapBE(temp)); - } - static void log(OpenRCT2::IStream* stream, const NetworkRideId_t& val) - { - char rideId[28] = {}; - snprintf(rideId, sizeof(rideId), "%u", val.id); - - stream->Write(rideId, strlen(rideId)); - - auto ride = get_ride(val.id); - 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) @@ -284,7 +256,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); @@ -584,34 +556,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 { @@ -655,6 +599,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) @@ -734,7 +722,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) @@ -745,7 +733,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) @@ -755,7 +743,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()); } }; @@ -779,49 +769,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) @@ -842,28 +789,57 @@ 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)); } }; + +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)); + } +}; diff --git a/src/openrct2/core/EnumMap.hpp b/src/openrct2/core/EnumMap.hpp new file mode 100644 index 0000000000..ae571d83db --- /dev/null +++ b/src/openrct2/core/EnumMap.hpp @@ -0,0 +1,156 @@ +/***************************************************************************** + * 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; + else + 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; + } + + return binarySearchValue(); + } + else + { + return binarySearchValue(); + } + } + + auto begin() const + { + return _map.begin(); + } + + auto end() const + { + return _map.end(); + } +}; 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/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/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/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/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 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); 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 6f751dc77c..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__ @@ -192,7 +193,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); @@ -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/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/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..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 @@ -112,6 +111,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/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/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/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/core/OrcaStream.hpp b/src/openrct2/core/OrcaStream.hpp new file mode 100644 index 0000000000..fbc330ae51 --- /dev/null +++ b/src/openrct2/core/OrcaStream.hpp @@ -0,0 +1,681 @@ +/***************************************************************************** + * 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); + } + else + { + 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/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/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/core/String.cpp b/src/openrct2/core/String.cpp index bb773e5df9..c1d3ee4c96 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 @@ -42,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) @@ -135,10 +138,8 @@ namespace String { break; } - else - { - len++; - } + + len++; } return std::string_view(ch, len); } @@ -165,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) @@ -186,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) @@ -248,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) @@ -303,10 +296,8 @@ namespace String { return -1; } - else - { - return lastOccurance - str; - } + + return lastOccurance - str; } size_t LengthOf(const utf8* str) @@ -788,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); }); @@ -818,11 +807,36 @@ namespace String { return trunc.substr(0, i); } - i += *length; + i += length.value(); } 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..a09e84c0ce 100644 --- a/src/openrct2/core/String.hpp +++ b/src/openrct2/core/String.hpp @@ -157,19 +157,19 @@ 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 }; } - return {}; + return std::nullopt; } /** @@ -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 diff --git a/src/openrct2/core/Zip.cpp b/src/openrct2/core/Zip.cpp index 0ca6e6e533..d87644dc4b 100644 --- a/src/openrct2/core/Zip.cpp +++ b/src/openrct2/core/Zip.cpp @@ -121,22 +121,20 @@ public: { return zipFileStat.size; } - else - { - return 0; - } + + return 0; } std::vector GetFileData(std::string_view path) const override { 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 +153,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 +169,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 +182,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 { @@ -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/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/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/drawing/Drawing.Sprite.BMP.cpp b/src/openrct2/drawing/Drawing.Sprite.BMP.cpp index 8c4f1d6e75..de822f9d83 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,28 @@ 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); - return; + DrawBMPSprite(dpi, args); } 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..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,36 +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) - { - paletteMap.Copy( - PALETTE_OFFSET_REMAP_TERTIARY, *tertiaryPaletteMap, PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); - } - } - - auto primaryPaletteMap = GetPaletteMapForColour(imageId.GetPrimary()); - if (primaryPaletteMap) + paletteMap = PaletteMap(gOtherPalette); + auto tertiaryPaletteMap = GetPaletteMapForColour(imageId.GetTertiary()); + if (tertiaryPaletteMap.has_value()) { paletteMap.Copy( - PALETTE_OFFSET_REMAP_PRIMARY, *primaryPaletteMap, 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) - { - paletteMap.Copy( - PALETTE_OFFSET_REMAP_SECONDARY, *secondaryPaletteMap, 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) @@ -575,19 +573,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); } } @@ -665,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()) { @@ -683,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) { @@ -697,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) @@ -794,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 4d8772ded8..4450706156 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" @@ -54,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; } @@ -65,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(); } /** @@ -373,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; @@ -386,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; @@ -525,6 +530,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()) @@ -542,132 +548,160 @@ 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; - - 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) + auto pixels = reinterpret_cast(const_cast(surface->pixels)); + auto pixelsLen = static_cast(surface->pitch) * surface->h; + for (size_t pp = 0; pp < pixelsLen; pp++) { - 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++) + if (pixels[pp] != 0) { - for (int32_t xx = 0; xx < width - 0; xx++) - { - if (*src != 0) - { - // 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]; - } - } - src++; - dst++; - } - // Skip any remaining bits - src += srcScanSkip; - dst += dstScanSkip; + pixels[pp] = colour; + } + else + { + pixels[pp] = PALETTE_INDEX_0; } } - { - 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; - } + auto baseId = uint32_t(0x7FFFF) - 1024; + auto imageId = baseId + _ttfGlId; + auto drawingEngine = dpi->DrawingEngine; + auto drawingContext = drawingEngine->GetDrawingContext(); + drawingEngine->InvalidateImage(imageId); + drawingContext->DrawBitmap(dpi, 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) + 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++) + { + for (int32_t xx = 0; xx < width - 0; xx++) + { + if (*src != 0) + { + // 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]; + } + } + 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; } } @@ -794,11 +828,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; } @@ -807,18 +841,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 @@ -924,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/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index 0894323ff4..30c3543a24 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, @@ -110,11 +110,11 @@ 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 */ -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, @@ -130,12 +130,12 @@ 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 @@ -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; } @@ -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/Drawing.h b/src/openrct2/drawing/Drawing.h index 2e28549e81..940aa7a8c3 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" @@ -105,11 +104,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{}; /** @@ -544,7 +543,6 @@ public: struct DrawSpriteArgs { - rct_drawpixelinfo* DPI; ImageId Image; const PaletteMap& PalMap; const rct_g1_element& SourceImage; @@ -555,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) @@ -660,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]; @@ -695,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 @@ -714,9 +710,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 @@ -790,5 +786,3 @@ std::optional GetPaletteG1Index(colour_t paletteId); std::optional GetPaletteMapForColour(colour_t paletteId); #include "NewDrawing.h" - -#endif diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index c68b4dcd0a..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] = {}; @@ -306,7 +310,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 +367,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 +434,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/Font.h b/src/openrct2/drawing/Font.h index 863dea90b2..0681240867 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" @@ -34,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; @@ -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/IDrawingContext.h b/src/openrct2/drawing/IDrawingContext.h index 2fe2aef713..adff81a6d6 100644 --- a/src/openrct2/drawing/IDrawingContext.h +++ b/src/openrct2/drawing/IDrawingContext.h @@ -18,19 +18,24 @@ namespace OpenRCT2::Drawing struct IDrawingContext { - virtual ~IDrawingContext() - { - } - + 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( + 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 0d679d2467..76552da80b 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; @@ -66,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; @@ -79,17 +84,15 @@ namespace OpenRCT2::Drawing virtual ~IDrawingEngineFactory() { } - virtual std::unique_ptr Create( + [[nodiscard]] virtual std::unique_ptr Create( DrawingEngine type, const std::shared_ptr& uiContext) abstract; }; 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/Image.cpp b/src/openrct2/drawing/Image.cpp index ea6ab9f4c3..f3bec68d23 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; @@ -176,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; @@ -234,7 +237,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); diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index fe7b313872..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); } } @@ -217,24 +235,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 colours with nonremappable colours, 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 +263,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 +274,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 +284,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 +296,7 @@ int32_t ImageImporter::CalculatePaletteIndex( } } } + return paletteIndex; } @@ -304,23 +322,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 e121414259..1ff1bc37d8 100644 --- a/src/openrct2/drawing/ImageImporter.h +++ b/src/openrct2/drawing/ImageImporter.h @@ -45,13 +45,26 @@ 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; 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); + 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); @@ -59,16 +72,18 @@ 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 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 +94,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 +107,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 +121,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 +135,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 +149,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 +163,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 +177,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 +191,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 +205,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 +219,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 +233,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 +247,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 +261,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 +275,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 +289,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 +303,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 +318,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 +346,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 (Extra grey) { 91, 91, 67, 255 }, { 107, 107, 83, 255 }, { 123, 123, 99, 255 }, @@ -331,7 +378,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 +392,6 @@ constexpr const GamePalette StandardPalette = { { { 63, 183, 255, 255 }, { 75, 207, 255, 255 }, - // 255 (unused?) - { 0, 0, 0, 255 }, + // 255 (Used in a small number of cases for pure white) + { 255, 255, 255, 255 }, } }; diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index c90abd7fed..86e32f1806 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; @@ -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); } @@ -710,6 +710,8 @@ void lightfx_add_lights_magic_vehicle(const Vehicle* vehicle) }; auto ride = vehicle->GetRide(); + if (ride == nullptr) + return; switch (ride->type) { diff --git a/src/openrct2/drawing/LightFX.h b/src/openrct2/drawing/LightFX.h index acbd5ed4be..13a43ed141 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__ @@ -19,7 +18,7 @@ struct Vehicle; struct rct_drawpixelinfo; struct GamePalette; struct CoordsXYZ; -struct SpriteBase; +struct EntityBase; enum class LightType : uint8_t { @@ -61,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); @@ -79,5 +78,3 @@ void lightfx_render_to_texture( const uint32_t* lightPalette); #endif // __ENABLE_LIGHTFX__ - -#endif diff --git a/src/openrct2/drawing/NewDrawing.cpp b/src/openrct2/drawing/NewDrawing.cpp index c1eb196933..01bb3b7bcf 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,23 +175,18 @@ 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()); } } -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; 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 +195,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 +222,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 +243,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 +253,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 +264,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 +274,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/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 7887bb8e6f..2c430f3672 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; } @@ -372,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..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; @@ -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 */ @@ -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/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index c095a02e8f..af6ad01080 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) @@ -112,16 +123,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( @@ -147,13 +152,14 @@ 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) { - utf8 buffer[512]; - format_string(buffer, sizeof(buffer), format, args); + const void* args = ft.Data(); - 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) { @@ -171,10 +177,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 7c32cfed44..40261dabb8 100644 --- a/src/openrct2/drawing/Text.h +++ b/src/openrct2/drawing/Text.h @@ -124,37 +124,12 @@ 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 = {}); -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 = {}); 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/drawing/Weather.cpp b/src/openrct2/drawing/Weather.cpp index 35eb7e0cff..c47794ef00 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" @@ -21,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); /** * @@ -52,7 +57,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; @@ -75,106 +80,110 @@ 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(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); + weatherDrawer->Draw(dpi, 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; - 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(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); + weatherDrawer->Draw(dpi, 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); + weatherDrawer->Draw(dpi, 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); + weatherDrawer->Draw(dpi, 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; - 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 = 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; 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(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); + weatherDrawer->Draw(dpi, 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); + weatherDrawer->Draw(dpi, 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); + weatherDrawer->Draw(dpi, 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; - 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 528e236892..f5266c836e 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" @@ -42,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++; @@ -57,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]; @@ -89,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]; @@ -200,8 +197,7 @@ void X8DrawingEngine::BeginDraw() Resize(_width, _height); } #endif - _weatherDrawer.SetDPI(&_bitsDPI); - _weatherDrawer.Restore(); + _weatherDrawer.Restore(&_bitsDPI); } } @@ -270,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; } @@ -283,7 +278,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) @@ -465,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; @@ -518,20 +511,19 @@ 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 -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) @@ -583,7 +575,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 @@ -649,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) @@ -702,8 +693,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); @@ -715,28 +707,29 @@ 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]; } } } } -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); @@ -744,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 e462871162..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,23 +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 SetDPI(rct_drawpixelinfo* dpi); + 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 + { + } }; } // namespace Drawing } // namespace OpenRCT2 diff --git a/src/openrct2/interface/Chat.cpp b/src/openrct2/interface/Chat.cpp index 0a50e66ebd..27e52fae64 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 @@ -206,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{}; @@ -216,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; @@ -226,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 d3885109f8..40db7583b9 100644 --- a/src/openrct2/interface/Chat.h +++ b/src/openrct2/interface/Chat.h @@ -7,11 +7,12 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _CHAT_H_ -#define _CHAT_H_ +#pragma once #include "../common.h" +#include + #define CHAT_HISTORY_SIZE 10 #define CHAT_INPUT_SIZE 1024 #define CHAT_MAX_MESSAGE_LENGTH 200 @@ -38,9 +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); - -#endif 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 diff --git a/src/openrct2/interface/Colour.h b/src/openrct2/interface/Colour.h index 44dd0e3719..e4f79b65dc 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" @@ -52,7 +51,9 @@ enum : colour_t COLOUR_BRIGHT_PINK, COLOUR_LIGHT_PINK, - COLOUR_COUNT + COLOUR_COUNT, + + COLOUR_NULL = 255, }; /** @@ -217,5 +218,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/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; 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/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/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index cc5741263f..5c17d1dec0 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); } } @@ -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])) @@ -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") { @@ -1259,15 +1280,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); @@ -1390,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) @@ -1765,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", @@ -1772,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" }, @@ -1788,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" }, @@ -1808,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/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 850a23b84f..b0f5c3a5b2 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -161,26 +161,24 @@ 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; - } - else - { - return ""; + return path.value(); } + + return ""; } std::string screenshot_dump_png_32bpp(int32_t width, int32_t height, const void* pixels) { auto path = screenshot_get_next_path(); - if (path == std::nullopt) + if (!path.has_value()) { return ""; } @@ -196,8 +194,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) { @@ -375,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() @@ -384,7 +382,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 +410,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; @@ -765,34 +763,32 @@ 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) { 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/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 6fde1dba5a..d1df3bfdb0 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -19,12 +19,14 @@ #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" #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" @@ -106,7 +108,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; } @@ -117,6 +119,30 @@ std::optional centre_2d_coordinates(const CoordsXYZ& loc, rct_vi return { screenCoord }; } +CoordsXYZ Focus::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 +160,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 Focus& focus) { rct_viewport* viewport = nullptr; if (_viewports.size() >= MAX_VIEWPORT_COUNT) @@ -151,11 +175,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,27 +186,19 @@ 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) + if (!centreLoc.has_value()) { log_error("Invalid location for viewport."); return; @@ -206,13 +218,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); } } } @@ -225,7 +237,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,10 +248,15 @@ 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 } }; + static constexpr CoordsXY corr[] = { + { -1, -1 }, + { 1, -1 }, + { 1, 1 }, + { -1, 1 }, + }; pos.x += corr[rotation].x * height; pos.y += corr[rotation].y * height; } @@ -327,10 +344,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 +358,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 +392,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 +446,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; @@ -514,7 +531,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) { @@ -543,7 +561,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) @@ -578,23 +596,23 @@ 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; } 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(); } } @@ -640,7 +658,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) @@ -652,8 +670,8 @@ 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) + auto centreLoc = centre_2d_coordinates(sprite->GetLocation(), window->viewport); + if (centreLoc.has_value()) { window->savedViewPos = *centreLoc; viewport_move(*centreLoc, window, window->viewport); @@ -664,134 +682,104 @@ 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; - } - else if (entity->Type == EntityType::Guest || entity->Type == EntityType::Staff) - { - Peep* peep = TryGetEntity(window->viewport_smart_follow_sprite); - if (peep == nullptr) - { - // will never happen - window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; - window->viewport_target_sprite = SPRITE_INDEX_NULL; - return; - } - - 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; - } -} - -viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep) -{ - viewport_focus focus{}; - focus.type = VIEWPORT_FOCUS_TYPE_SPRITE; - focus.sprite.sprite_id = 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; - } - else - { - 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 train = GetEntity(ride->vehicles[peep->CurrentTrain]); - if (train != nullptr) - { - const auto car = train->GetCar(peep->CurrentCar); - if (car != nullptr) - { - 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(); - } - - window->viewport_focus_sprite = focus.sprite; - window->viewport_target_sprite = window->viewport_focus_sprite.sprite_id; - return focus; -} - -void viewport_update_smart_staff_follow(rct_window* window, Peep* peep) -{ - sprite_focus focus = {}; - - focus.sprite_id = window->viewport_smart_follow_sprite; - - 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 + + switch (entity->Type) { - focus.type |= VIEWPORT_FOCUS_TYPE_SPRITE | VIEWPORT_FOCUS_TYPE_COORDINATE; + case EntityType::Vehicle: + viewport_update_smart_vehicle_follow(window); + break; + + case EntityType::Guest: + viewport_update_smart_guest_follow(window, entity->As()); + break; + + case EntityType::Staff: + 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->focus = Focus(window->viewport_smart_follow_sprite); + window->viewport_target_sprite = window->viewport_smart_follow_sprite; + break; + } +} + +void viewport_update_smart_guest_follow(rct_window* window, const Guest* peep) +{ + 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->focus = std::nullopt; // No focus + return; } - window->viewport_focus_sprite = focus; - window->viewport_target_sprite = window->viewport_focus_sprite.sprite_id; + 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 train = GetEntity(ride->vehicles[peep->CurrentTrain]); + if (train != nullptr) + { + const auto car = train->GetCar(peep->CurrentCar); + if (car != nullptr) + { + focus = Focus(car->sprite_index); + overallFocus = false; + window->viewport_target_sprite = car->sprite_index; + } + } + } + } + + if (peep->x == LOCATION_NULL && overallFocus) + { + auto ride = get_ride(peep->CurrentRide); + if (ride != nullptr) + { + auto xy = ride->overall_view.ToTileCentre(); + CoordsXYZ coordFocus; + coordFocus.x = xy.x; + coordFocus.y = xy.y; + coordFocus.z = tile_element_height(xy) + (4 * COORDS_Z_STEP); + focus = Focus(coordFocus); + window->viewport_target_sprite = SPRITE_INDEX_NULL; + } + } + + window->focus = focus; +} + +void viewport_update_smart_staff_follow(rct_window* window, const Staff* peep) +{ + if (peep->State == PeepState::Picked) + { + window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; + window->viewport_target_sprite = SPRITE_INDEX_NULL; + window->focus = std::nullopt; + return; + } + + 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) { - // Can be expanded in the future if needed - 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->focus = Focus(window->viewport_smart_follow_sprite); + window->viewport_target_sprite = window->viewport_smart_follow_sprite; } /** @@ -805,45 +793,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,8 +931,6 @@ static void viewport_paint_column(paint_session* session) { PaintDrawMoneyStructs(&session->DPI, session->PSStringHead); } - - PaintSessionFree(session); } /** @@ -960,34 +944,33 @@ 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, const ScreenRect& screenRect, 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 = 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; - right = left + width; - bottom = top + height; + topLeft.x &= bitmask; + topLeft.y &= bitmask; - int16_t x = static_cast(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; - int16_t y = static_cast(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); @@ -995,10 +978,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(); @@ -1012,16 +995,22 @@ 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) { - 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); } - // 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); @@ -1030,17 +1019,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; } @@ -1062,9 +1051,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); } } @@ -1090,7 +1097,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; @@ -1102,8 +1109,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) @@ -1143,16 +1150,14 @@ 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) { - 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); } @@ -1376,9 +1381,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 +1494,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 +1516,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 +1542,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 +1567,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); @@ -1625,9 +1630,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 @@ -1717,8 +1722,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; @@ -1737,9 +1742,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) @@ -1759,31 +1764,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 }); } } @@ -1852,7 +1849,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) @@ -1877,7 +1874,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); @@ -1888,10 +1885,10 @@ 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) + if (!mapCoords.has_value()) return std::nullopt; *quadrant = map_get_tile_quadrant(*mapCoords); @@ -1905,7 +1902,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); @@ -1916,10 +1913,10 @@ 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) + if (!mapCoords.has_value()) return std::nullopt; *side = map_get_tile_side(*mapCoords); @@ -1949,7 +1946,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) @@ -1983,8 +1980,6 @@ ZoomLevel ZoomLevel::min() { return -2; } - else - { - return 0; - } + + return 0; } diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 0c7afab621..d97b8a544f 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" @@ -21,11 +20,12 @@ struct paint_session; struct RecordedPaintSession; struct paint_struct; struct rct_drawpixelinfo; -struct Peep; struct TileElement; struct rct_window; +struct EntityBase; +struct Guest; +struct Staff; union paint_entry; -struct SpriteBase; enum { @@ -78,7 +78,7 @@ struct InteractionInfo union { TileElement* Element = nullptr; - SpriteBase* Entity; + EntityBase* Entity; }; ViewportInteractionItem SpriteType = ViewportInteractionItem::None; }; @@ -104,22 +104,20 @@ 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 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); -viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep); -void viewport_update_smart_staff_follow(rct_window* window, Peep* 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( - 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, int16_t left, int16_t top, int16_t right, int16_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); @@ -148,18 +146,16 @@ 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, 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(); - -#endif diff --git a/src/openrct2/interface/Widget.h b/src/openrct2/interface/Widget.h index 3f8735f90b..f8734ee889 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" @@ -41,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 @@ -144,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); @@ -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.cpp b/src/openrct2/interface/Window.cpp index d12d1b5318..9d7d5420f5 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; @@ -229,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 @@ -349,7 +348,7 @@ void window_close_top() if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { - if (gS6Info.editor_step != EditorStep::LandscapeEditor) + if (gEditorStep != EditorStep::LandscapeEditor) return; } @@ -428,15 +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; } - 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) + 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; @@ -458,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)) @@ -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,15 +513,15 @@ 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) +template static void widget_invalidate_by_condition(TPred pred) { window_visit_each([pred](rct_window* w) { if (pred(w)) @@ -567,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; @@ -578,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) @@ -623,7 +623,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; @@ -732,7 +733,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) @@ -806,7 +807,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) @@ -834,15 +835,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 +872,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; } } @@ -910,7 +911,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; @@ -927,9 +928,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; } @@ -940,7 +941,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,13 +972,13 @@ 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 }); auto centreLoc = centre_2d_coordinates({ map_x, map_y, z }, w->viewport); - if (!centreLoc) + if (!centreLoc.has_value()) { log_error("Invalid location."); return; @@ -1019,10 +1020,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); @@ -1082,11 +1083,11 @@ 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)) { - 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); } @@ -1245,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) @@ -1281,8 +1282,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); @@ -1290,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); @@ -1338,10 +1340,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); @@ -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) @@ -1581,14 +1584,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) @@ -1631,18 +1633,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 @@ -1721,7 +1711,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; @@ -1762,8 +1752,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; } } @@ -1812,7 +1803,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); @@ -1842,7 +1833,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); @@ -1872,7 +1863,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); @@ -1902,7 +1893,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); @@ -2090,7 +2081,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) { @@ -2194,64 +2185,64 @@ rct_windowclass window_get_classification(rct_window* window) */ void WidgetScrollUpdateThumbs(rct_window* w, rct_widgetindex widget_index) { - rct_widget* widget = &w->widgets[widget_index]; - rct_scroll* scroll = &w->scrolls[window_get_scroll_data_index(w, widget_index)]; + const auto& widget = w->widgets[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) + int32_t view_size = widget.width() - 21; + 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) + x = widget.width() - 2; + 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) + int32_t view_size = widget.height() - 21; + 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) + y = widget.height() - 2; + 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)))); } } } diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index bbfb9bac2e..ec92b3e0e3 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" @@ -21,6 +20,7 @@ #include #include #include +#include struct rct_drawpixelinfo; struct rct_window; @@ -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 @@ -41,7 +42,6 @@ enum class CursorID : 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; @@ -131,8 +131,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 @@ -146,12 +146,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; @@ -195,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 Focus { - 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 Focus(T newValue, uint8_t newZoom = 0) { - sprite_focus sprite; - coordinate_focus coordinate; - }; + data = newValue; + zoom = newZoom; + } + + CoordsXYZ GetPos() const; + + constexpr bool operator==(const Focus& other) const + { + if (zoom != other.zoom) + { + return false; + } + return data == other.data; + } + constexpr bool operator!=(const Focus& other) const + { + return !(*this == other); + } }; struct rct_window_event_list @@ -326,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; @@ -418,8 +395,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, @@ -542,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 @@ -767,8 +744,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); @@ -777,7 +754,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); @@ -805,8 +782,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(); @@ -894,11 +869,9 @@ 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; rct_window* window_get_listening(); rct_windowclass window_get_classification(rct_window* window); - -#endif diff --git a/src/openrct2/interface/Window_internal.cpp b/src/openrct2/interface/Window_internal.cpp index 3db47f0186..35aaa071db 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 || !focus.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 = 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 9fd1784815..42649726cd 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -45,22 +45,24 @@ struct rct_window int16_t max_width{}; int16_t min_height{}; int16_t max_height{}; - rct_windownumber number{}; - uint16_t flags{}; - rct_scroll scrolls[3]; - uint8_t list_item_positions[1024]{}; - uint16_t no_list_items{}; // 0 for no items - int16_t selected_list_item{}; // -1 for none selected union { - coordinate_focus viewport_focus_coordinates; - sprite_focus viewport_focus_sprite; + rct_windownumber number{}; + ride_id_t rideId; + }; + uint16_t flags{}; + rct_scroll scrolls[3]; + 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 focus; + union + { campaign_variables campaign; new_ride_variables new_ride; news_variables news; map_variables map; ride_variables ride; - scenery_variables scenery; track_list_variables track_list; error_variables error; void* custom_info; @@ -173,9 +175,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) { } 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/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 375d579fa3..93ad9f7f0b 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -58,6 +58,7 @@ + @@ -67,6 +68,7 @@ + @@ -157,12 +159,14 @@ + + @@ -173,8 +177,8 @@ - + @@ -183,6 +187,7 @@ + @@ -254,6 +259,8 @@ + + @@ -282,8 +289,10 @@ + + @@ -305,12 +314,15 @@ + + + @@ -327,6 +339,7 @@ + @@ -351,6 +364,7 @@ + @@ -391,7 +405,9 @@ + + @@ -404,27 +420,38 @@ + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + + @@ -440,6 +467,7 @@ + @@ -461,7 +489,7 @@ - + @@ -482,6 +510,7 @@ + @@ -493,6 +522,7 @@ + @@ -582,6 +612,7 @@ + @@ -683,6 +714,8 @@ + + @@ -724,6 +757,7 @@ + @@ -804,6 +838,7 @@ + @@ -847,6 +882,20 @@ + + + + + + + + + + + + + + @@ -864,6 +913,7 @@ + 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/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/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/FormatCodes.cpp b/src/openrct2/localisation/FormatCodes.cpp index 204afcaa11..1b4b9d569f 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, }, @@ -95,17 +96,12 @@ std::string_view FormatTokenToString(FormatToken token, bool withBraces) { return GetFormatTokenStringWithBraces(token); } - else - { - for (const auto& t : FormatTokenMap) - { - if (t.second == token) - { - return t.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/Formatter.h b/src/openrct2/localisation/Formatter.h index 49d03febb6..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{}; @@ -72,8 +74,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( @@ -82,6 +84,8 @@ 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, 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> || @@ -90,14 +94,14 @@ public: ); // clang-format on - uintptr_t convertedValue; - if constexpr (std::is_integral_v) + uint64_t convertedValue; + if constexpr (std::is_integral_v || std::is_enum_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)); diff --git a/src/openrct2/localisation/Formatting.cpp b/src/openrct2/localisation/Formatting.cpp index 6c64e6e9f6..a3a6289311 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); } @@ -618,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) { @@ -657,6 +659,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 +761,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..e67c2cf9df 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 { @@ -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 557bbe4197..a7b1889226 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" @@ -115,27 +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; - } -} -#endif + 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 b17e29017d..65a7f220e8 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) @@ -157,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; @@ -173,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 @@ -468,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); @@ -579,13 +574,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/Localisation.Date.cpp b/src/openrct2/localisation/Localisation.Date.cpp index 7d7dd6f7ec..aed68d3158 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" @@ -18,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; @@ -61,7 +62,6 @@ void date_reset() { gDateMonthsElapsed = 0; gDateMonthTicks = 0; - gCurrentTicks = 0; gCurrentRealTimeTicks = 0; } diff --git a/src/openrct2/localisation/Localisation.cpp b/src/openrct2/localisation/Localisation.cpp index 48728c7844..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; @@ -445,8 +446,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 +457,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/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/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/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/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index c3a474e0da..4a442a83d7 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -7,15 +7,14 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _STRING_IDS_H_ -#define _STRING_IDS_H_ +#pragma once #include "../common.h" 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, @@ -2171,52 +2170,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, @@ -2911,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, @@ -3951,8 +3904,17 @@ enum STR_COPY_BUILD_HASH = 6453, + STR_CANT_RENAME_BANNER = 6454, + STR_CANT_RENAME_SIGN = 6455, + + STR_SHORTCUT_GIANT_SCREENSHOT = 6456, + + STR_FILE_BUG_ON_GITHUB = 6457, + + 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 }; - -#endif 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/Award.cpp b/src/openrct2/management/Award.cpp index f6cb615059..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" @@ -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/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/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/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index c93eabe5af..14c9654de2 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() @@ -211,8 +209,8 @@ 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()) + Ride* ride = get_ride(static_cast(subject)); + if (ride == nullptr || ride->overall_view.IsNull()) { break; } @@ -226,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; @@ -253,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; } @@ -262,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; } @@ -271,7 +269,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/management/Research.cpp b/src/openrct2/management/Research.cpp index 8aaf119e70..d7d9c4944f 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; } @@ -316,7 +315,7 @@ void research_update() return; } - if (gScenarioTicks % 32 != 0) + if (gCurrentTicks % 32 != 0) { return; } @@ -416,12 +415,12 @@ static void research_insert_researched(ResearchItem&& item) * * rct2: 0x006857CF */ -void research_remove(ResearchItem* researchItem) +void ResearchRemove(const 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; @@ -430,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; @@ -507,6 +506,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) @@ -558,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) @@ -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) @@ -694,23 +687,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; } /** @@ -870,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; } @@ -932,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) @@ -988,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); @@ -1012,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..3271eef7fc 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. @@ -175,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 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); 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 05782288d9..ecb0b72df5 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" @@ -37,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 "0" +#define NETWORK_STREAM_VERSION "18" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; @@ -49,6 +50,10 @@ 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. +// This limit is per connection, the current value was determined by tests with fuzzing. +static constexpr uint32_t MaxPacketsPerUpdate = 100; + # include "../Cheats.h" # include "../ParkImporter.h" # include "../Version.h" @@ -57,7 +62,6 @@ static constexpr uint32_t CHUNK_SIZE = 1024 * 63; # 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" @@ -101,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) + : OpenRCT2::System(context) { wsa_initialized = false; mode = NETWORK_MODE_NONE; @@ -144,11 +147,6 @@ NetworkBase::NetworkBase() _server_log_fs << std::unitbuf; } -void NetworkBase::SetEnvironment(const std::shared_ptr& env) -{ - _env = env; -} - bool NetworkBase::Init() { status = NETWORK_STATUS_READY; @@ -424,7 +422,7 @@ NetworkAuth NetworkBase::GetAuthStatus() { return _serverConnection->AuthStatus; } - else if (GetMode() == NETWORK_MODE_SERVER) + if (GetMode() == NETWORK_MODE_SERVER) { return NetworkAuth::Ok; } @@ -557,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 { gNetwork.Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); } break; @@ -572,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 { gNetwork.Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); server_connect_time = platform_get_ticks(); @@ -589,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 { gNetwork.Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); break; } @@ -702,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; @@ -843,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++) { @@ -861,10 +861,8 @@ std::string NetworkBase::GetMasterServerUrl() { return OPENRCT2_MASTER_SERVER_URL; } - else - { - return gConfigNetwork.master_server_url; - } + + return gConfigNetwork.master_server_url; } NetworkGroup* NetworkBase::AddGroup() @@ -914,9 +912,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; @@ -938,7 +936,7 @@ uint8_t NetworkBase::GetDefaultGroup() void NetworkBase::SetDefaultGroup(uint8_t id) { - if (GetGroupByID(id)) + if (GetGroupByID(id) != nullptr) { default_group = id; } @@ -1069,7 +1067,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()) { @@ -1084,7 +1082,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)); @@ -1098,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 = GetContext().GetPlatformEnvironment(); + auto directory = env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_CHAT); _chatLogPath = BeginLog(directory, "", _chatLogFilenameFormat); # if defined(_WIN32) && !defined(__MINGW32__) @@ -1109,7 +1108,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()) { @@ -1124,7 +1123,8 @@ void NetworkBase::CloseChatLog() void NetworkBase::BeginServerLog() { - auto directory = _env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_SERVER); + auto env = GetContext().GetPlatformEnvironment(); + auto directory = env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_SERVER); _serverLogPath = BeginLog(directory, ServerName, _serverLogFilenameFormat); # if defined(_WIN32) && !defined(__MINGW32__) @@ -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) @@ -1338,7 +1338,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; } @@ -1358,7 +1358,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; } @@ -1366,15 +1366,15 @@ 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(); } auto header = save_for_network(objects); if (header.empty()) { - if (connection) + if (connection != nullptr) { connection->SetLastDisconnectReason(STR_MULTIPLAYER_CONNECTION_CLOSED); connection->Disconnect(); @@ -1388,7 +1388,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)); } @@ -1417,7 +1417,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()); @@ -1654,8 +1654,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 +1684,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()) { @@ -1698,13 +1701,21 @@ 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()) { auto commandHandler = it->second; if (connection.AuthStatus == NetworkAuth::Ok || !packet.CommandRequiresAuth()) { - (this->*commandHandler)(connection, packet); + try + { + (this->*commandHandler)(connection, packet); + } + catch (const std::exception& ex) + { + log_verbose("Exception during packet processing: %s", ex.what()); + } } } @@ -1835,7 +1846,7 @@ void NetworkBase::ProcessPlayerList() { // Add new player. player = AddPlayer("", ""); - if (player) + if (player != nullptr) { *player = pendingPlayer; if (player->Flags & NETWORK_PLAYER_FLAG_ISSERVER) @@ -1956,7 +1967,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); } @@ -1967,7 +1978,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, @@ -1975,7 +1986,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 @@ -2047,7 +2058,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); } @@ -2169,10 +2180,10 @@ 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) + if (snapshot != nullptr) { MemoryStream snapshotMemory; DataSerialiser ds(true, snapshotMemory); @@ -2222,8 +2233,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; } @@ -2253,9 +2265,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) { @@ -2264,8 +2276,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); @@ -2293,7 +2305,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; @@ -2324,7 +2336,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]{}; @@ -2364,7 +2376,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{}; @@ -2410,18 +2422,17 @@ 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); const GameStateSnapshot_t* desyncSnapshot = snapshots->GetLinkedSnapshot(tick); - if (desyncSnapshot) + if (desyncSnapshot != nullptr) { 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()); @@ -2459,7 +2470,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; } @@ -2469,10 +2480,16 @@ 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)); + 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()); @@ -2497,15 +2514,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; } @@ -2524,7 +2540,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."); @@ -2564,24 +2580,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); @@ -2644,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 { 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); @@ -2716,11 +2732,11 @@ 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()); + objManager.LoadObjects(loadResult.RequiredObjects); importer->Import(); EntityTweener::Get().Reset(); @@ -2817,10 +2833,10 @@ bool NetworkBase::SaveMap(IStream* stream, const std::vectorGroup); - if (!group || !group->CanPerformCommand(GameCommand::Chat)) + if (group == nullptr || !group->CanPerformCommand(GameCommand::Chat)) { return; } } - std::string text = szText; + std::string text(szText); if (connection.Player != nullptr) { if (!ProcessChatMessagePluginHooks(connection.Player->Id, text)) @@ -3012,8 +3028,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; } @@ -3070,7 +3086,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); @@ -3087,7 +3103,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; } @@ -3097,12 +3113,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); } } @@ -3134,32 +3148,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; } } @@ -3174,7 +3187,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); @@ -3197,139 +3210,135 @@ void NetworkBase::Client_Handle_GAMEINFO([[maybe_unused]] NetworkConnection& con network_chat_show_server_greeting(); } -void network_set_env(const std::shared_ptr& env) -{ - gNetwork.SetEnvironment(env); -} - -void network_close() -{ - gNetwork.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(); @@ -3339,7 +3348,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; @@ -3349,104 +3359,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() @@ -3480,28 +3503,30 @@ 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); + return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE); } - if (!gNetwork.GetGroupByID(groupId)) + 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 && fromgroup->Id != 0) + 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) @@ -3511,18 +3536,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(), @@ -3539,16 +3564,17 @@ 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); + return std::make_unique(GameActions::Status::Unknown, STR_CANT_DO_THIS, STR_NONE); } } } @@ -3558,19 +3584,19 @@ 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 : gNetwork.player_list) + 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) { - gNetwork.RemoveGroup(groupId); + network.RemoveGroup(groupId); } } break; @@ -3579,23 +3605,23 @@ 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 = 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( - 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) { - NetworkGroup* group = gNetwork.GetGroupByID(groupId); + NetworkGroup* group = network.GetGroupByID(groupId); if (group != nullptr) { if (permissionState != PermissionState::Toggle) @@ -3622,7 +3648,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) @@ -3649,49 +3675,51 @@ 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) { - gNetwork.SetDefaultGroup(groupId); + network.SetDefaultGroup(groupId); } } 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); } - 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 // early. - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, 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); + return std::make_unique(GameActions::Status::Disallowed, STR_CANT_KICK_THE_HOST, STR_NONE); } 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(); @@ -3699,7 +3727,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() @@ -3713,36 +3742,37 @@ 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) { - 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); - if (player) + NetworkPlayer* player = network.GetPlayerByID(playerid); + if (player != nullptr) { player->PickupPeep = peep; } @@ -3751,31 +3781,31 @@ 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 = network.GetPlayerByID(playerid); + if (player != nullptr) { - NetworkPlayer* player = gNetwork.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) { - 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); - if (player) + NetworkPlayer* player = network.GetPlayerByID(playerid); + if (player != nullptr) { player->PickupPeepOldX = x; } @@ -3784,58 +3814,54 @@ 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 = network.GetPlayerByID(playerid); + if (player != nullptr) { - NetworkPlayer* player = gNetwork.GetPlayerByID(playerid); - if (player) - { - return player->PickupPeepOldX; - } - return -1; + return player->PickupPeepOldX; } + return -1; } int32_t network_get_current_player_group_index() { - NetworkPlayer* player = gNetwork.GetPlayerByID(gNetwork.GetPlayerID()); - if (player) + auto& network = OpenRCT2::GetContext()->GetNetwork(); + NetworkPlayer* player = network.GetPlayerByID(network.GetPlayerID()); + if (player != nullptr) { return network_get_group_index(player->Group); } return -1; } -void network_send_map() -{ - gNetwork.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); } } } @@ -3843,19 +3869,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)) @@ -3866,36 +3894,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) +void network_append_chat_log(std::string_view 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) @@ -3921,27 +3952,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() @@ -3951,12 +3988,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() @@ -3966,7 +4005,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() @@ -4009,9 +4049,6 @@ void network_request_gamestate_snapshot() void network_send_game_action(const GameAction* action) { } -void network_send_map() -{ -} void network_update() { } @@ -4164,15 +4201,9 @@ 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() { } -void network_set_env(const std::shared_ptr&) -{ -} void network_shutdown_client() { } @@ -4187,7 +4218,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 8981377d9e..95d6dc8db2 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" @@ -12,21 +13,26 @@ #ifndef DISABLE_NETWORK -class NetworkBase +namespace OpenRCT2 +{ + struct IContext; +} + +class NetworkBase : public OpenRCT2::System { public: - NetworkBase(); + NetworkBase(OpenRCT2::IContext& context); public: // Uncategorized bool BeginServer(uint16_t port, const std::string& address); 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(); - 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(); @@ -37,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; @@ -90,13 +96,13 @@ 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); 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); @@ -173,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/NetworkConnection.cpp b/src/openrct2/network/NetworkConnection.cpp index ffb0e46e1d..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() @@ -61,13 +60,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]; @@ -191,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/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/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/network/NetworkPacket.cpp b/src/openrct2/network/NetworkPacket.cpp index ee71eebf8b..44ed917bf4 100644 --- a/src/openrct2/network/NetworkPacket.cpp +++ b/src/openrct2/network/NetworkPacket.cpp @@ -66,40 +66,45 @@ 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) { - if (BytesRead + size > Header.Size) + if (BytesRead + size > Data.size()) { return nullptr; } - else - { - uint8_t* data = &GetData()[BytesRead]; - BytesRead += size; - return data; - } + + const uint8_t* data = Data.data() + BytesRead; + BytesRead += size; + return data; } -const utf8* NetworkPacket::ReadString() +std::string_view NetworkPacket::ReadString() { - char* str = reinterpret_cast(&GetData()[BytesRead]); - char* strend = str; - while (BytesRead < Header.Size && *strend != 0) + if (BytesRead >= Data.size()) + return {}; + + const char* str = reinterpret_cast(Data.data() + BytesRead); + + size_t stringLen = 0; + while (BytesRead < Data.size() && str[stringLen] != '\0') { BytesRead++; - strend++; - } - if (*strend != 0) - { - return nullptr; + stringLen++; } + + if (str[stringLen] != '\0') + 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..0fd69b03df 100644 --- a/src/openrct2/network/NetworkPlayer.h +++ b/src/openrct2/network/NetworkPlayer.h @@ -11,13 +11,14 @@ #include "../Game.h" #include "../common.h" -#include "../peep/Peep.h" #include "../world/Map.h" #include +#include #include struct NetworkPacket; +struct Peep; class NetworkPlayer final { @@ -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/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/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/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 diff --git a/src/openrct2/network/NetworkUser.cpp b/src/openrct2/network/NetworkUser.cpp index 456262e814..31fc00412f 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; @@ -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++; @@ -172,9 +170,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; /** 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/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..3bde48a7ee 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -22,6 +22,7 @@ #include #include +#include #include struct GameAction; @@ -35,20 +36,13 @@ 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(); 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,67 +52,64 @@ 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 = {}); 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_chat_log(std::string_view 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/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.cpp b/src/openrct2/object/FootpathObject.cpp index 6de138b344..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.string_idx = _legacyType.string_idx; - _pathSurfaceEntry.image = _legacyType.image; - _pathSurfaceEntry.preview = _legacyType.image + 71; - _pathSurfaceEntry.flags = _legacyType.flags; + _pathSurfaceDescriptor.Name = _legacyType.string_idx; + _pathSurfaceDescriptor.Image = _legacyType.image; + _pathSurfaceDescriptor.PreviewImage = _legacyType.GetPreviewImage(); + _pathSurfaceDescriptor.Flags = _legacyType.flags; - _queueEntry.string_idx = _legacyType.string_idx; - _queueEntry.image = _legacyType.image + 51; - _queueEntry.preview = _legacyType.image + 72; - _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.string_idx = _legacyType.string_idx; - _pathRailingsEntry.bridge_image = _legacyType.bridge_image; - _pathRailingsEntry.preview = _legacyType.image + 71; - _pathRailingsEntry.flags = _legacyType.flags; - _pathRailingsEntry.scrolling_mode = _legacyType.scrolling_mode; - _pathRailingsEntry.support_type = _legacyType.support_type; - _pathRailingsEntry.railings_image = _legacyType.image + 73; + _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.preview, screenCoords - ScreenCoordsXY{ 49, 17 }, 0); - gfx_draw_sprite(dpi, _queueEntry.preview, 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 7fe5274cdb..ebe409ae58 100644 --- a/src/openrct2/object/FootpathObject.h +++ b/src/openrct2/object/FootpathObject.h @@ -16,34 +16,29 @@ class FootpathObject final : public Object { private: rct_footpath_entry _legacyType = {}; - PathSurfaceEntry _pathSurfaceEntry = {}; - PathSurfaceEntry _queueEntry = {}; - PathRailingsEntry _pathRailingsEntry = {}; + PathSurfaceDescriptor _pathSurfaceDescriptor = {}; + PathSurfaceDescriptor _queueSurfaceDescriptor = {}; + PathRailingsDescriptor _pathRailingsDescriptor = {}; public: - explicit FootpathObject(const rct_object_entry& entry) - : Object(entry) - { - } - void* GetLegacyData() override { return &_legacyType; } - PathSurfaceEntry* GetPathSurfaceEntry() + const PathSurfaceDescriptor& GetPathSurfaceDescriptor() const { - return &_pathSurfaceEntry; + return _pathSurfaceDescriptor; } - PathSurfaceEntry* GetQueueEntry() + const PathSurfaceDescriptor& GetQueueSurfaceDescriptor() const { - return &_queueEntry; + return _queueSurfaceDescriptor; } - PathRailingsEntry* 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 new file mode 100644 index 0000000000..b1045726f1 --- /dev/null +++ b/src/openrct2/object/FootpathRailingsObject.cpp @@ -0,0 +1,103 @@ +/***************************************************************************** + * 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; + } + + _descriptor.Name = NameStringId; + _descriptor.BridgeImage = BridgeImageId; + _descriptor.PreviewImage = PreviewImageId; + _descriptor.Flags = Flags; + _descriptor.ScrollingMode = ScrollingMode; + _descriptor.SupportType = SupportType; + _descriptor.SupportColour = Colour; + _descriptor.RailingsImage = RailingsImageId; +} + +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..15bc15edd0 --- /dev/null +++ b/src/openrct2/object/FootpathRailingsObject.h @@ -0,0 +1,42 @@ +/***************************************************************************** + * 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{}; + PathRailingsDescriptor _descriptor = {}; + +public: + 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; + + 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 new file mode 100644 index 0000000000..bb20157c11 --- /dev/null +++ b/src/openrct2/object/FootpathSurfaceObject.cpp @@ -0,0 +1,74 @@ +/***************************************************************************** + * 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; + } + + _descriptor.Name = NameStringId; + _descriptor.Image = BaseImageId; + _descriptor.PreviewImage = PreviewImageId; + _descriptor.Flags = Flags; +} + +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..b6c3e7cfa2 --- /dev/null +++ b/src/openrct2/object/FootpathSurfaceObject.h @@ -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 "../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{}; + PathSurfaceDescriptor _descriptor = {}; + +public: + 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; + + const PathSurfaceDescriptor& GetDescriptor() const + { + return _descriptor; + } +}; diff --git a/src/openrct2/object/ImageTable.cpp b/src/openrct2/object/ImageTable.cpp index ab2e033ba3..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) { @@ -270,15 +293,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; @@ -368,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"); @@ -377,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) { @@ -389,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 acd6aeea0d..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,15 +33,18 @@ 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]] 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 */ - static std::vector> ParseImages(IReadObjectContext* context, json_t& el); - static std::vector> LoadObjectImages( + [[nodiscard]] static std::vector> ParseImages( + IReadObjectContext* context, std::vector>& imageSources, 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.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/LargeSceneryObject.h b/src/openrct2/object/LargeSceneryObject.h index a39e387880..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; @@ -43,9 +38,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/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/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 6de569acdf..fcf5477b67 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" @@ -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() @@ -152,92 +217,60 @@ void Object::SetAuthors(std::vector&& authors) _authors = std::move(authors); } -std::optional rct_object_entry::GetSceneryType() const +bool rct_object_entry::IsEmpty() 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; - } + 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; } -/** - * 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 +bool rct_object_entry::operator==(const rct_object_entry& rhs) const { -private: - std::unique_ptr _zipArchive; - std::unique_ptr _base; + const auto a = this; + const auto b = &rhs; -public: - ZipStreamWrapper(std::unique_ptr zipArchive, std::unique_ptr base) - : _zipArchive(std::move(zipArchive)) - , _base(std::move(base)) + // 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 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 rct_object_entry::operator!=(const rct_object_entry& rhs) const +{ + return !(*this == rhs); +} bool ObjectAsset::IsAvailable() const { @@ -245,11 +278,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 @@ -258,17 +289,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) - { - auto size = zipArchive->GetFileSize(*index); - return size; - } + auto size = zipArchive->GetFileSize(index.value()); + return size; } } return 0; @@ -280,35 +309,19 @@ 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 {}; } -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 0f3761986c..666ae1555d 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 @@ -42,6 +43,8 @@ enum class ObjectType : uint8_t TerrainEdge, Station, Music, + FootpathSurface, + FootpathRailings, Count, None = 255 @@ -116,12 +119,14 @@ struct rct_object_entry flags |= (static_cast(newType) & 0x0F); } - std::optional GetSceneryType() const; - ObjectSourceGame GetSourceGame() const { 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); @@ -159,30 +164,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; @@ -222,9 +224,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 @@ -251,12 +253,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() @@ -287,7 +289,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 @@ -301,22 +302,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(); @@ -334,10 +351,6 @@ public: { } - virtual ObjectType GetObjectType() const final - { - return _objectEntry.GetType(); - } virtual std::string GetName() const; virtual std::string GetName(int32_t language) const; @@ -371,8 +384,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 db5865e54a..bb011d0884 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" @@ -253,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); @@ -285,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); @@ -307,54 +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(); + break; + case ObjectType::FootpathRailings: + result = std::make_unique(); break; default: throw std::runtime_error("Invalid object type"); @@ -392,6 +403,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; } @@ -485,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 74ea1787c7..6aef398f28 100644 --- a/src/openrct2/object/ObjectFactory.h +++ b/src/openrct2/object/ObjectFactory.h @@ -17,14 +17,16 @@ struct IObjectRepository; class Object; struct rct_object_entry; +enum class ObjectType : uint8_t; 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(ObjectType type); - 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/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..9057a36c69 100644 --- a/src/openrct2/object/ObjectList.cpp +++ b/src/openrct2/object/ObjectList.cpp @@ -18,10 +18,10 @@ #include "ObjectRepository.h" #include +#include #include // 98DA00 -// clang-format off int32_t object_entry_group_counts[] = { MAX_RIDE_OBJECTS, // rides MAX_SMALL_SCENERY_OBJECTS, // small scenery @@ -38,9 +38,13 @@ int32_t object_entry_group_counts[] = { MAX_TERRAIN_EDGE_OBJECTS, MAX_STATION_OBJECTS, MAX_MUSIC_OBJECTS, + MAX_FOOTPATH_SURFACE_OBJECTS, + MAX_FOOTPATH_RAILINGS_OBJECTS, }; +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, @@ -52,21 +56,138 @@ int32_t object_entry_group_encoding[] = { CHUNK_ENCODING_RLE, CHUNK_ENCODING_RLE, CHUNK_ENCODING_RLE, - CHUNK_ENCODING_ROTATE + CHUNK_ENCODING_ROTATE, }; // 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; } /** @@ -100,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; @@ -133,28 +254,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* 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); @@ -164,20 +263,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) diff --git a/src/openrct2/object/ObjectList.h b/src/openrct2/object/ObjectList.h index 62cbe2cdca..ceae5ec119 100644 --- a/src/openrct2/object/ObjectList.h +++ b/src/openrct2/object/ObjectList.h @@ -15,8 +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); -const rct_object_entry* get_loaded_object_entry(size_t index); -void* get_loaded_object_chunk(size_t index); diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index b72f6c0bd8..123b0ceeb6 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,11 +64,17 @@ public: { return nullptr; } - return _loadedObjects[index].get(); + return _loadedObjects[index]; } 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 @@ -82,13 +89,31 @@ public: Object* GetLoadedObject(const ObjectEntryDescriptor& entry) override { - Object* loadedObject = nullptr; const ObjectRepositoryItem* ori = _objectRepository.FindObject(entry); - if (ori != nullptr) + if (ori == nullptr) + return nullptr; + + return ori->LoadedObject.get(); + } + + ObjectEntryIndex GetLoadedObjectEntryIndex(std::string_view identifier) override + { + const auto* obj = GetLoadedObject(ObjectEntryDescriptor(identifier)); + if (obj != nullptr) { - loadedObject = ori->LoadedObject; + return GetLoadedObjectEntryIndex(obj); } - return loadedObject; + 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 @@ -114,35 +139,41 @@ public: return RepositoryItemToObject(ori); } - void LoadObjects(const rct_object_entry* entries, size_t count) override + Object* LoadObject(const ObjectEntryDescriptor& descriptor) override { - // Find all the required objects - auto requiredObjects = GetRequiredObjects(entries, count); - - // Load the required objects - size_t numNewLoadedObjects = 0; - auto loadedObjects = LoadObjects(requiredObjects, &numNewLoadedObjects); - - SetNewLoadedObjectList(std::move(loadedObjects)); - LoadDefaultObjects(); - UpdateSceneryGroupIndexes(); - ResetTypeToRideEntryIndexMap(); - log_verbose("%u / %u new objects loaded", numNewLoadedObjects, requiredObjects.size()); + const ObjectRepositoryItem* ori = _objectRepository.FindObject(descriptor); + return RepositoryItemToObject(ori); } - void UnloadObjects(const std::vector& entries) override + void LoadObjects(const ObjectList& objectList) override + { + // Find all the required objects + auto requiredObjects = GetRequiredObjects(objectList); + + // Load the required objects + LoadObjects(requiredObjects); + + // Load defaults. + LoadDefaultObjects(); + + // Update indices. + UpdateSceneryGroupIndexes(); + ResetTypeToRideEntryIndexMap(); + } + + 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; + auto* loadedObject = ori->LoadedObject.get(); if (loadedObject != nullptr) { UnloadObject(loadedObject); @@ -160,9 +191,9 @@ public: void UnloadAll() override { - for (auto& object : _loadedObjects) + for (auto* object : _loadedObjects) { - UnloadObject(object.get()); + UnloadObject(object); } UpdateSceneryGroupIndexes(); ResetTypeToRideEntryIndexMap(); @@ -188,9 +219,10 @@ 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->IsJsonObject()) + && item->LoadedObject->GetGeneration() == ObjectGeneration::DAT) { objects.push_back(item); } @@ -333,40 +365,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; - if (loadedObject == nullptr) + if (_loadedObjects.size() > static_cast(*slot) && _loadedObjects[*slot] != nullptr) { - ObjectType objectType = ori->ObjectEntry.GetType(); - 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) - { - 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(); - } + _loadedObjects.resize(slot.value() + 1); } + loadedObject = object; + _loadedObjects[slot.value()] = object; + UpdateSceneryGroupIndexes(); + ResetTypeToRideEntryIndexMap(); } } return loadedObject; @@ -383,12 +414,12 @@ private: _loadedObjects.resize(i + 1); return static_cast(i); } - else if (_loadedObjects[i] == nullptr) + if (_loadedObjects[i] == nullptr) { return static_cast(i); } } - return {}; + return std::nullopt; } size_t GetLoadedObjectIndex(const Object* object) @@ -396,8 +427,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(_loadedObjects.begin(), _loadedObjects.end(), object); if (it != _loadedObjects.end()) { result = std::distance(_loadedObjects.begin(), it); @@ -405,45 +435,26 @@ 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) + if (object == nullptr) + return; + + object->Unload(); + + // TODO try to prevent doing a repository search + const auto* ori = _objectRepository.FindObject(object->GetDescriptor()); + 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,77 +462,69 @@ private: { if (object != nullptr) { - exceptSet.insert(object.get()); + exceptSet.insert(object); } } // 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.get()) == exceptSet.end()) - { - UnloadObject(object.get()); - numObjectsUnloaded++; - } + UnloadObject(object); + numObjectsUnloaded++; } } log_verbose("%u / %u objects unloaded", numObjectsUnloaded, totalObjectsLoaded); } + template void UpdateSceneryGroupIndexes(Object* object) + { + auto* sceneryEntry = static_cast(object->GetLegacyData()); + sceneryEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(object); + } + void UpdateSceneryGroupIndexes() { - for (auto& loadedObject : _loadedObjects) + 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: + UpdateSceneryGroupIndexes(loadedObject); + break; + case ObjectType::LargeScenery: + UpdateSceneryGroupIndexes(loadedObject); + break; + case ObjectType::Walls: + UpdateSceneryGroupIndexes(loadedObject); + break; + case ObjectType::Banners: + UpdateSceneryGroupIndexes(loadedObject); + break; + case ObjectType::PathBits: + UpdateSceneryGroupIndexes(loadedObject); + break; + case ObjectType::SceneryGroup: { - 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 sgObject = dynamic_cast(loadedObject); + sgObject->UpdateEntryIndexes(); + break; } + default: + // This switch only handles scenery ObjectTypes. + break; } } @@ -532,7 +535,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); @@ -544,79 +547,29 @@ 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; - 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 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()) @@ -651,61 +604,51 @@ private: } } - std::vector> LoadObjects( - std::vector& requiredObjects, size_t* outNewObjectsLoaded) + void LoadObjects(std::vector& requiredObjects) { - std::vector> objects; - std::vector loadedObjects; - std::vector badObjects; + 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) { - auto requiredObject = requiredObjects[i]; - std::unique_ptr object; + ParallelFor(requiredObjects, [this, &commonMutex, requiredObjects, &objects, &badObjects, &newLoadedObjects](size_t i) { + auto* requiredObject = requiredObjects[i]; + 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); + badObjects.push_back(ObjectEntryDescriptor(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,37 +656,47 @@ private: if (!badObjects.empty()) { // Unload all the new objects we loaded - for (auto object : loadedObjects) + for (auto* object : newLoadedObjects) { UnloadObject(object); } throw ObjectLoadException(std::move(badObjects)); } - if (outNewObjectsLoaded != nullptr) + // Unload objects which are not in the required list. + if (objects.empty()) { - *outNewObjectsLoaded = loadedObjects.size(); + UnloadAll(); } - return objects; + else + { + UnloadObjectsExcept(objects); + } + + _loadedObjects = std::move(objects); + + log_verbose("%u / %u new objects loaded", newLoadedObjects.size(), requiredObjects.size()); } - 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() @@ -755,33 +708,32 @@ 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)); } } } } - 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) @@ -808,13 +760,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(); @@ -841,7 +786,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 37f54cfb05..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 @@ -27,14 +28,16 @@ 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; 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; @@ -43,13 +46,12 @@ 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(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_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.cpp b/src/openrct2/object/ObjectRepository.cpp index e436e36563..4663730a63 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" @@ -76,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; @@ -113,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(); @@ -128,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; @@ -136,7 +141,7 @@ protected: ds << item.Sources; ds << item.Authors; - switch (item.ObjectEntry.GetType()) + switch (item.Type) { case ObjectType::Ride: ds << item.RideInfo.RideFlags; @@ -148,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; @@ -256,28 +264,26 @@ 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, 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; } @@ -297,7 +303,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); @@ -310,10 +316,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); @@ -414,7 +420,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(); @@ -425,15 +439,16 @@ private: { _newItemMap[item.Identifier] = index; } - _itemMap[item.ObjectEntry] = index; + if (!item.ObjectEntry.IsEmpty()) + { + _itemMap[item.ObjectEntry] = index; + } 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) @@ -554,45 +569,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) @@ -606,7 +629,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."); } @@ -631,14 +654,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: @@ -717,51 +742,17 @@ 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); 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 +763,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/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index bf2af60b25..f967591db2 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -37,13 +37,15 @@ 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; std::string Name; std::vector Authors; std::vector Sources; - Object* LoadedObject{}; + std::shared_ptr LoadedObject{}; struct { uint8_t RideFlags; @@ -54,13 +56,17 @@ struct ObjectRepositoryItem { std::vector Entries; } SceneryGroupInfo; + struct + { + uint8_t Flags{}; + } FootpathSurfaceInfo; - ObjectSourceGame GetFirstSourceGame() const + [[nodiscard]] ObjectSourceGame GetFirstSourceGame() const { if (Sources.empty()) return ObjectSourceGame::Custom; - else - return static_cast(Sources[0]); + + return static_cast(Sources[0]); } }; @@ -70,30 +76,32 @@ 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; - virtual void RegisterLoadedObject(const ObjectRepositoryItem* ori, Object* object) abstract; + [[nodiscard]] virtual std::unique_ptr LoadObject(const ObjectRepositoryItem* ori) 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; - 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; }; -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/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index b475785b5b..bcb40af3fa 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" @@ -386,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); @@ -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; } 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.cpp b/src/openrct2/object/SceneryGroupObject.cpp index aa6a8bfd20..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(); @@ -81,13 +100,13 @@ 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(); - if (sceneryType != std::nullopt) + auto sceneryType = GetSceneryType(ori->Type); + 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/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.cpp b/src/openrct2/object/SmallSceneryObject.cpp index a9aa6d30fd..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; } @@ -158,14 +157,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. @@ -215,7 +212,7 @@ ObjectEntryDescriptor SmallSceneryObject::GetScgPiratHeader() const ObjectEntryDescriptor SmallSceneryObject::GetScgMineHeader() const { - return ObjectEntryDescriptor("rct2.scgpirat"); + return ObjectEntryDescriptor("rct2.scgmine"); } ObjectEntryDescriptor SmallSceneryObject::GetScgAbstrHeader() 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.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..6965a81592 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 @@ -28,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.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 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/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index dcec3ea8b0..c710b2f4a0 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" @@ -52,33 +53,43 @@ 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) +static int32_t RemapPositionToQuadrant(const paint_struct& ps, uint8_t rotation) { - auto pos = CoordsXY{ static_cast(ps.bounds.x), static_cast(ps.bounds.y) }.Rotate(rotation); - switch (rotation) + constexpr auto MapRangeMax = MaxPaintQuadrants * COORDS_XY_STEP; + constexpr auto MapRangeCenter = MapRangeMax / 2; + + 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: - break; + return x + y; case 1: - case 3: - pos.x += 0x2000; - break; + // Because one component may be the maximum we add the center to be a positive value. + return (y - x) + MapRangeCenter; case 2: - pos.x += 0x4000; - break; + // 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 pos.x + pos.y; + return 0; } 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); + 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 - 1); + ps->quadrant_index = paintQuadrantIndex; ps->next_quadrant_ps = session->Quadrants[paintQuadrantIndex]; session->Quadrants[paintQuadrantIndex] = ps; @@ -145,7 +156,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; @@ -178,7 +189,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)); @@ -189,8 +199,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); @@ -203,24 +212,27 @@ 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) { 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; } @@ -233,10 +245,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); @@ -299,11 +308,21 @@ template<> bool CheckBoundingBox<3>(const paint_struct_bound_box& initialBBox, c return false; } -template +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; @@ -312,9 +331,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 { @@ -324,55 +346,72 @@ 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; - const bool compareResult = CheckBoundingBox<_TRotation>(initialBBox, currentBBox); + const bool compareResult = CheckBoundingBox(initialBBox, currentBBox); 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; @@ -411,12 +450,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); } } } @@ -445,8 +484,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) { @@ -490,7 +529,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); @@ -506,7 +545,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 }; @@ -522,7 +561,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 +647,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) { @@ -699,14 +738,6 @@ paint_struct* PaintAddImageAsParent( return PaintAddImageAsParent(session, image_id, offset, boundBoxSize, offset); } -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) -{ - 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 * @@ -741,16 +772,6 @@ paint_struct* PaintAddImageAsParent( return ps; } -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) -{ - 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 @@ -769,13 +790,10 @@ 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)); - session->LastPS = nullptr; session->LastAttachedPS = nullptr; @@ -831,12 +849,10 @@ 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)); 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 +866,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 +899,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 +936,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, int32_t y, int32_t z, int8_t y_offsets[], int32_t offset_x, uint32_t rotation) { auto* ps = session->AllocateStringPaintEntry(); @@ -938,8 +954,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..0117d4b2ad 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -14,93 +14,73 @@ #include "../drawing/Drawing.h" #include "../interface/Colour.h" #include "../world/Location.hpp" +#include "../world/Map.h" #include #include struct TileElement; +enum class RailingEntrySupportType : uint8_t; enum class ViewportInteractionItem : uint8_t; -#pragma pack(push, 1) -/* size 0x12 */ struct attached_paint_struct { - uint32_t image_id; // 0x00 + attached_paint_struct* next; + 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 - uint8_t pad_0D; - attached_paint_struct* next; // 0x0E -}; -#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 -{ - PAINT_QUADRANT_FLAG_IDENTICAL = (1 << 0), - PAINT_QUADRANT_FLAG_BIGGER = (1 << 7), - PAINT_QUADRANT_FLAG_NEXT = (1 << 1), + int32_t x; + int32_t y; + uint8_t 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 + 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 { - 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 + int32_t x; + int32_t y; + int32_t map_x; + int32_t map_y; uint16_t quadrant_index; uint8_t flags; - uint8_t quadrant_flags; - attached_paint_struct* attached_ps; // 0x1C - paint_struct* children; - paint_struct* next_quadrant_ps; // 0x24 - ViewportInteractionItem sprite_type; // 0x28 - uint8_t var_29; - uint16_t pad_2A; - uint16_t map_x; // 0x2C - uint16_t map_y; // 0x2E - TileElement* tileElement; // 0x30 (or sprite pointer) + uint8_t SortFlags; + ViewportInteractionItem sprite_type; }; -#ifdef PLATFORM_32BIT -// TODO: drop packing from this when all rendering is done. -assert_struct_size(paint_struct, 0x34); -#endif 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; }; -#pragma pack(pop) union paint_entry { @@ -135,7 +115,10 @@ struct tunnel_entry uint8_t type; }; -#define MAX_PAINT_QUADRANTS 512 +// 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 /** @@ -190,15 +173,15 @@ public: struct PaintSessionCore { - paint_struct* Quadrants[MAX_PAINT_QUADRANTS]; + paint_struct* Quadrants[MaxPaintQuadrants]; paint_struct* LastPS; paint_string_struct* PSStringHead; paint_string_struct* LastPSString; 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; @@ -269,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; @@ -289,48 +284,50 @@ extern bool gPaintBoundingBoxes; 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_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_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); +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); -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, 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, 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..243e5bca95 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) { @@ -21,37 +21,59 @@ 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( - 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) { 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, 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( + 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, 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, { offset.y, offset.x, offset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z }, + { boundBoxOffset.y, boundBoxOffset.x, boundBoxOffset.z }); } + + 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 }); + } + + return PaintAddImageAsParent(session, image_id, offset, boundBoxSize); } 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) { @@ -59,12 +81,24 @@ 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); +} + +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, 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, { offset.y, offset.x, offset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z }, + { boundBoxOffset.y, boundBoxOffset.x, boundBoxOffset.z }); } + + 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/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); diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index d42d93c05e..d8b20b2c45 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -10,7 +10,9 @@ #include "Supports.h" #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" @@ -18,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 */ @@ -74,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 */ @@ -305,12 +307,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 { @@ -401,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 */ @@ -460,13 +458,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; @@ -481,10 +474,6 @@ bool wooden_a_supports_paint_setup( height -= z; if (height < 0) { - if (underground != nullptr) - { - *underground = true; - } return false; } height /= 16; @@ -505,10 +494,6 @@ bool wooden_a_supports_paint_setup( height -= 2; if (height < 0) { - if (underground != nullptr) - { - *underground = true; - } return false; } @@ -535,10 +520,6 @@ bool wooden_a_supports_paint_setup( height--; if (height < 0) { - if (underground != nullptr) - { - *underground = true; - } return false; } @@ -607,8 +588,7 @@ 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, { bBox.offset.x, bBox.offset.y, bBox.offset.z + z }); hasSupports = true; } else @@ -641,21 +621,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; } @@ -664,8 +640,6 @@ bool wooden_b_supports_paint_setup( if (supportLength < 0) { - if (underground != nullptr) - *underground = true; // STC return false; } @@ -682,8 +656,6 @@ bool wooden_b_supports_paint_setup( heightSteps -= 2; if (heightSteps < 0) { - if (underground != nullptr) - *underground = true; // STC return false; } @@ -701,7 +673,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; @@ -712,8 +685,6 @@ bool wooden_b_supports_paint_setup( heightSteps -= 1; if (heightSteps < 0) { - if (underground != nullptr) - *underground = true; // STC return false; } @@ -757,8 +728,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 +737,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; @@ -779,7 +750,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) @@ -787,13 +758,13 @@ 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, 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, + { boundBox.offset.x, boundBox.offset.y, boundBox.offset.z + baseHeight }); _9E32B1 = true; } else @@ -810,8 +781,6 @@ bool wooden_b_supports_paint_setup( } } - if (underground != nullptr) - *underground = false; // AND return _9E32B1; } @@ -1082,8 +1051,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, - _97B062[ebp].x, _97B062[ebp].y, 1, baseHeight); + { SupportBoundBoxes[originalSegment] + loc_97B052[ebp], baseHeight }, { _97B062[ebp], 1 }); } int32_t si = baseHeight; @@ -1099,8 +1067,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, 0, 0, 5, - supportSegments[segment].height); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment], supportSegments[segment].height }, { 0, 0, 5 }); baseHeight = supportSegments[segment].height + 6; } @@ -1115,8 +1082,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], baseHeight }, { 0, 0, heightDiff - 1 }); } baseHeight += heightDiff; @@ -1151,8 +1118,7 @@ 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], baseHeight }, { 0, 0, beamLength - 1 }); baseHeight += beamLength; i++; @@ -1181,8 +1147,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, - 0, 0, 0, baseHeight, SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, height); + session, imageId | imageColourFlags, { SupportBoundBoxes[originalSegment], baseHeight }, { 0, 0, 0 }, + { SupportBoundBoxes[originalSegment], height }); baseHeight += beamLength; } } @@ -1197,14 +1163,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, - PathRailingsEntry* railingEntry, bool* underground) + const FootpathPaintInfo& pathPaintInfo, bool* underground) { if (underground != nullptr) { @@ -1237,7 +1203,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, (pathPaintInfo.BridgeImageId + 48) | imageColourFlags, { 0, 0, baseHeight - 2 }, { 32, 32, 0 }); hasSupports = true; } else if (session->Support.slope & 0x10) @@ -1251,13 +1218,14 @@ bool path_a_supports_paint_setup( } uint32_t imageId = (supportType * 24) + word_97B3C4[session->Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK] - + railingEntry->bridge_image; + + pathPaintInfo.BridgeImageId; PaintAddImageAsParent( 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; @@ -1273,7 +1241,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; + + pathPaintInfo.BridgeImageId; PaintAddImageAsParent(session, ebx | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); @@ -1285,19 +1253,20 @@ 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) + pathPaintInfo.BridgeImageId + 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; } else { - uint32_t imageId = (supportType * 24) + railingEntry->bridge_image + 22; + uint32_t imageId = (supportType * 24) + pathPaintInfo.BridgeImageId + 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; @@ -1308,16 +1277,16 @@ bool path_a_supports_paint_setup( { uint16_t specialIndex = (special - 1) & 0xFFFF; - uint32_t imageId = railingEntry->bridge_image + 55 + specialIndex; + uint32_t imageId = pathPaintInfo.BridgeImageId + 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, 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, + { boundBox.offset.x, boundBox.offset.y, baseHeight + boundBox.offset.z }); hasSupports = true; } else @@ -1347,13 +1316,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, - PathRailingsEntry* railingEntry) + const FootpathPaintInfo& pathPaintInfo) { support_height* supportSegments = session->SupportSegments; @@ -1375,7 +1344,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)) + || !(pathPaintInfo.RailingFlags & RAILING_ENTRY_FLAG_HAS_SUPPORT_BASE_SPRITE)) { baseHeight = supportSegments[segment].height; } @@ -1385,8 +1354,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, (pathPaintInfo.BridgeImageId + 37 + imageOffset) | imageColourFlags, + { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, 5 }); baseHeight += 6; } @@ -1404,8 +1373,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, (pathPaintInfo.BridgeImageId + 20 + (heightDiff - 1)) | imageColourFlags, + { SupportBoundBoxes[segment], baseHeight }, { 0, 0, heightDiff - 1 }); } baseHeight += heightDiff; @@ -1437,8 +1406,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, (pathPaintInfo.BridgeImageId + 20 + (z - 1)) | imageColourFlags, + { SupportBoundBoxes[segment], baseHeight }, { 0, 0, (z - 1) }); baseHeight += z; } @@ -1448,15 +1417,14 @@ bool path_b_supports_paint_setup( break; } - uint32_t imageId = railingEntry->bridge_image + 20 + (z - 1); + uint32_t imageId = pathPaintInfo.BridgeImageId + 20 + (z - 1); if (z == 16) { imageId += 1; } PaintAddImageAsParent( - session, imageId | imageColourFlags, SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, 0, 0, (z - 1), - baseHeight); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, (z - 1) }); baseHeight += z; } @@ -1483,10 +1451,10 @@ bool path_b_supports_paint_setup( break; } - uint32_t imageId = railingEntry->bridge_image + 20 + (z - 1); + uint32_t imageId = pathPaintInfo.BridgeImageId + 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], baseHeight }, { 0, 0, 0 }, + { SupportBoundBoxes[segment], baseHeight }); baseHeight += z; } diff --git a/src/openrct2/paint/Supports.h b/src/openrct2/paint/Supports.h index 69f9956d09..95c52baca3 100644 --- a/src/openrct2/paint/Supports.h +++ b/src/openrct2/paint/Supports.h @@ -7,28 +7,29 @@ * 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" +struct FootpathPaintInfo; + 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( 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); + 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, - PathRailingsEntry* railingEntry); + 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 @@ -54,5 +55,3 @@ enum { SUPPORTS_SLOPE_5 = 1 << 5 }; - -#endif 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/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.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/paint/sprite/Paint.Peep.cpp b/src/openrct2/paint/sprite/Paint.Peep.cpp index 804e6f5026..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" @@ -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 @@ -80,7 +75,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/sprite/Paint.Sprite.cpp b/src/openrct2/paint/sprite/Paint.Sprite.cpp index 2db53b9db1..f85702a72a 100644 --- a/src/openrct2/paint/sprite/Paint.Sprite.cpp +++ b/src/openrct2/paint/sprite/Paint.Sprite.cpp @@ -32,13 +32,12 @@ * 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)) + if (!map_is_location_valid(pos)) { return; } - if (gTrackDesignSaveMode || (session->ViewFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES)) { return; @@ -52,7 +51,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) { @@ -70,21 +69,23 @@ void sprite_paint_setup(paint_session* session, const uint16_t x, const uint16_t } } + 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; } @@ -92,8 +93,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; } @@ -104,8 +105,8 @@ void sprite_paint_setup(paint_session* session, const uint16_t x, const uint16_t 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/paint/sprite/Paint.Sprite.h b/src/openrct2/paint/sprite/Paint.Sprite.h index 1c038aa53a..68a1d4e8e5 100644 --- a/src/openrct2/paint/sprite/Paint.Sprite.h +++ b/src/openrct2/paint/sprite/Paint.Sprite.h @@ -7,17 +7,15 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _PAINT_SPRITE_H -#define _PAINT_SPRITE_H +#pragma once #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); extern const uint32_t vehicle_particle_base_sprites[5]; - -#endif diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index 0b3f492ba6..9006830aa4 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" @@ -32,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; @@ -43,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; @@ -61,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); @@ -69,28 +64,32 @@ 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(reinterpret_cast(&bannerElement))) + { + image_id |= CONSTRUCTION_MARKER; + } else { 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); 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); // Opposite direction 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 8a7b106617..7b0ab9c16d 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" @@ -29,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; } @@ -47,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); @@ -65,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; @@ -92,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; @@ -100,6 +102,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(reinterpret_cast(&tile_element))) + { + image_id = CONSTRUCTION_MARKER; + entranceImageId = image_id; + if (transparant_image_id) + transparant_image_id = image_id; + } if (is_exit) { @@ -120,7 +129,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, 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) { @@ -139,7 +148,8 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, 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) { @@ -158,7 +168,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(); @@ -196,7 +206,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, { 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); @@ -208,7 +218,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; @@ -222,21 +232,27 @@ 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(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(); - PathSurfaceEntry* path_entry = nullptr; + uint8_t part_index = tile_element.GetSequenceIndex(); + 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->AsEntrance()->GetPathType()); + { + surfaceDescriptor = tile_element.GetPathSurfaceDescriptor(); + } rct_entrance_type* entrance; uint8_t di = ((direction / 2 + part_index / 2) & 1) ? 0x1A : 0x20; @@ -244,10 +260,10 @@ 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; - PaintAddImageAsParent(session, image_id, 0, 0, 32, 0x1C, 0, height, 0, 2, height); + image_id = (surfaceDescriptor->Image + 5 * (1 + (direction & 1))) | ghost_id; + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 0x1C, 0 }, { 0, 2, height }); } entrance = static_cast(object_entry_get_chunk(ObjectType::ParkEntrance, 0)); @@ -256,7 +272,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; @@ -309,7 +325,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; } @@ -318,7 +334,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); @@ -328,30 +344,30 @@ 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; - 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 }); } } - 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 155a442efb..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" @@ -19,6 +20,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" @@ -27,7 +29,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) @@ -51,9 +53,9 @@ 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); + int32_t clearanceHeight = ceil2(tileElement.GetClearanceZ() + 15, 16); if (tile->flags & LARGE_SCENERY_TILE_FLAG_ALLOW_SUPPORTS_ABOVE) { @@ -220,19 +222,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; - 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; @@ -242,28 +244,30 @@ 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()); - CoordsXYZ boxlength; - CoordsXYZ boxoffset; + image_id |= SPRITE_ID_PALETTE_COLOUR_2(tileElement.GetPrimaryColour(), tileElement.GetSecondaryColour()); if (gTrackDesignSaveMode) { - if (!track_design_save_contains_tile_element(tileElement)) + if (!track_design_save_contains_tile_element(reinterpret_cast(&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()) + 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(reinterpret_cast(&tileElement))) + { + image_id &= 0x7FFFF; + dword_F4387C = CONSTRUCTION_MARKER; + image_id |= dword_F4387C; + } + int32_t boxlengthZ = tile->z_clearance; if (boxlengthZ > 0x80) { @@ -275,17 +279,12 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei if (edi & 0xF00) { edi &= 0xF000; - edi = rol16(edi, direction); + edi = Numerics::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, boxlength.x, boxlength.y, boxlengthZ, height, boxoffset.x, boxoffset.y, boxoffset.z); + 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) { large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); @@ -295,7 +294,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); @@ -310,13 +309,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(); @@ -408,14 +407,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; @@ -430,7 +429,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(); @@ -449,7 +448,7 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei 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/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 1b6e59dfa2..53a492ddd0 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -7,12 +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" @@ -23,58 +29,52 @@ #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 -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[] = { @@ -83,18 +83,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, - PathRailingsEntry* 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 TileElement* tileElement, int16_t height, PathSurfaceEntry* footpathEntry, - PathRailingsEntry* railingEntry, 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( - 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; @@ -103,7 +103,7 @@ static void path_bit_lights_paint( { imageId = pathBitEntry->image + 1; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -114,7 +114,7 @@ static void path_bit_lights_paint( { imageId = pathBitEntry->image + 2; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -126,7 +126,7 @@ static void path_bit_lights_paint( { imageId = pathBitEntry->image + 3; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -138,7 +138,7 @@ static void path_bit_lights_paint( { imageId = pathBitEntry->image + 4; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -149,14 +149,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)) { @@ -171,7 +171,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() & Numerics::ror8(0x3, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } @@ -192,7 +192,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() & Numerics::ror8(0xC, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } @@ -214,7 +214,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() & Numerics::ror8(0x30, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } @@ -236,7 +236,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() & Numerics::ror8(0xC0, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } @@ -248,7 +248,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; @@ -257,7 +257,7 @@ static void path_bit_benches_paint( { imageId = pathBitEntry->image + 1; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -268,7 +268,7 @@ static void path_bit_benches_paint( { imageId = pathBitEntry->image + 2; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -280,7 +280,7 @@ static void path_bit_benches_paint( { imageId = pathBitEntry->image + 3; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -292,7 +292,7 @@ static void path_bit_benches_paint( { imageId = pathBitEntry->image + 4; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -322,18 +322,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, - PathRailingsEntry* railingEntry, uint32_t imageFlags) + paint_session* session, const PathElement& pathElement, uint16_t height, uint32_t connectedEdges, bool hasSupports, + const FootpathPaintInfo& pathPaintInfo, uint32_t imageFlags) { - uint32_t base_image_id = railingEntry->railings_image | imageFlags; + uint32_t base_image_id = pathPaintInfo.RailingsImageId | 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 }); @@ -368,8 +367,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: @@ -401,8 +400,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: @@ -411,17 +410,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; @@ -432,22 +431,20 @@ static void sub_6A4101( uint32_t imageId = (direction << 1) + base_image_id + 28; // Draw pole in the back - PaintAddImageAsParent( - session, imageId, 0, 0, 1, 1, 21, height, 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; boundBoxOffsets.y = BannerBoundBoxes[direction][1].y; imageId++; - PaintAddImageAsParent( - session, imageId, 0, 0, 1, 1, 21, height, boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 21 }, boundBoxOffsets); 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; + uint16_t scrollingMode = pathPaintInfo.ScrollingMode; scrollingMode += direction; auto ft = Formatter(); @@ -490,15 +487,15 @@ 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()) + auto slopeRailingsSupported = !(pathPaintInfo.SurfaceFlags & FOOTPATH_ENTRY_FLAG_NO_SLOPE_RAILINGS); + if ((hasSupports || slopeRailingsSupported) && 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 }); @@ -520,7 +517,7 @@ static void sub_6A4101( } else { - if (!word_F3F038) + if (!hasSupports) { return; } @@ -558,8 +555,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 }); @@ -584,8 +581,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 }); @@ -661,16 +658,16 @@ 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) + * @param railingsDescriptor (0x00F3EF6C) * @param imageFlags (0x00F3EF70) * @param sceneryImageFlags (0x00F3EF74) */ static void sub_6A3F61( - paint_session* session, const TileElement* tile_element, uint16_t connectedEdges, uint16_t height, - PathRailingsEntry* railingEntry, uint32_t imageFlags, uint32_t sceneryImageFlags, bool word_F3F038) + paint_session* session, const PathElement& pathElement, uint16_t connectedEdges, uint16_t height, + const FootpathPaintInfo& pathPaintInfo, uint32_t imageFlags, uint32_t sceneryImageFlags, bool hasSupports) { // eax -- // ebx -- @@ -691,7 +688,7 @@ static void sub_6A3F61( if (!gTrackDesignSaveMode) { - if (tile_element->AsPath()->HasAddition()) + if (pathElement.HasAddition()) { session->InteractionType = ViewportInteractionItem::FootpathItem; if (sceneryImageFlags != 0) @@ -700,7 +697,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) @@ -708,7 +705,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; @@ -719,17 +716,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: @@ -750,13 +747,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, hasSupports, pathPaintInfo, 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) { @@ -801,10 +797,35 @@ 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 */ -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; @@ -815,15 +836,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)); } @@ -834,25 +855,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(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; @@ -866,15 +892,19 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile } 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 { - 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; } @@ -915,22 +945,22 @@ 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; } 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 }); } } 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; } @@ -940,45 +970,38 @@ 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(); - - if (footpathEntry != nullptr && railingEntry != nullptr) + auto pathPaintInfo = GetFootpathPaintInfo(tileElement); + if (pathPaintInfo.SupportType == RailingEntrySupportType::Pole) { - if (railingEntry->support_type == RailingEntrySupportType::Pole) - { - path_paint_pole_support( - session, tile_element, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags); - } - else - { - path_paint_box_support( - session, tile_element, height, footpathEntry, railingEntry, 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__ 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); @@ -990,37 +1013,32 @@ 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, - PathRailingsEntry* 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) { - 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] }; uint16_t edi = edges | (corners << 4); - uint32_t imageId; - if (tileElement->AsPath()->IsSloped()) + uint32_t imageId = pathPaintInfo.SurfaceImageId; + 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 { - imageId = byte_98D6E0[edi]; + imageId += byte_98D6E0[edi]; } - imageId += footpathEntry->image; - if (!session->DidPassSurface) { boundBoxOffset.x = 3; @@ -1034,7 +1052,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) { @@ -1045,29 +1063,27 @@ 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, 0 }, + { boundBoxOffset, height + boundingBoxZOffset }); } else { uint32_t image_id; - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { - image_id = ((tileElement->AsPath()->GetSlopeDirection() + session->CurrentRotation) - & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) - + railingEntry->bridge_image + 51; + image_id = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + + pathPaintInfo.BridgeImageId + 51; } else { - image_id = byte_98D8A4[edges] + railingEntry->bridge_image + 49; + image_id = byte_98D8A4[edges] + pathPaintInfo.BridgeImageId + 49; } 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, 0 }, + { boundBoxOffset, height + boundingBoxZOffset }); - // TODO: Revert this when path import works correctly. - if (!pathElement->IsQueue() && !pathElement->ShouldDrawPathOverSupports()) + if (!pathElement.IsQueue() && !pathElement.ShouldDrawPathOverSupports()) { // don't draw } @@ -1079,38 +1095,32 @@ void path_paint_box_support( } } - sub_6A3F61(session, tileElement, edi, height, railingEntry, imageFlags, sceneryImageFlags, hasSupports); + sub_6A3F61(session, pathElement, edi, height, pathPaintInfo, 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) - { - 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 (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; @@ -1140,36 +1150,32 @@ void path_paint_box_support( } void path_paint_pole_support( - paint_session* session, const TileElement* tileElement, int16_t height, PathSurfaceEntry* footpathEntry, - PathRailingsEntry* railingEntry, 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) { - 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()) + uint32_t imageId = pathPaintInfo.SurfaceImageId; + if (pathElement.IsSloped()) { - imageId = ((tileElement->AsPath()->GetSlopeDirection() + session->CurrentRotation) & 3) + 16; + imageId += ((pathElement.GetSlopeDirection() + session->CurrentRotation) & 3) + 16; } else { - imageId = byte_98D6E0[edi]; + imageId += byte_98D6E0[edi]; } - imageId += footpathEntry->image; - // Below Surface if (!session->DidPassSurface) { @@ -1184,7 +1190,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) { @@ -1195,30 +1201,29 @@ 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 { 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; + + pathPaintInfo.BridgeImageId + 16; } else { - bridgeImage = edges + railingEntry->bridge_image; + bridgeImage = edges + pathPaintInfo.BridgeImageId; bridgeImage |= imageFlags; } 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, 0 }, + { boundBoxOffset, 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, @@ -1226,10 +1231,11 @@ void path_paint_pole_support( } } - sub_6A3F61(session, tileElement, edi, height, railingEntry, imageFlags, sceneryImageFlags, hasSupports); // TODO: arguments + sub_6A3F61(session, pathElement, edi, height, pathPaintInfo, imageFlags, sceneryImageFlags, + hasSupports); // TODO: arguments uint16_t ax = 0; - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { ax = 8; } @@ -1245,25 +1251,28 @@ void path_paint_pole_support( { if (!(edges & (1 << i))) { - path_b_supports_paint_setup(session, supports[i], ax, height, imageFlags, railingEntry); + 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); } } 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 e07c6bd115..79dc4ede3f 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" @@ -31,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; @@ -48,18 +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(reinterpret_cast(&sceneryElement))) + { + marker = CONSTRUCTION_MARKER; + } - auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); + auto* sceneryEntry = sceneryElement.GetEntry(); if (sceneryEntry == nullptr) { @@ -71,9 +75,9 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co 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[] = { @@ -93,13 +97,13 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co { 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; @@ -114,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; @@ -126,46 +130,45 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co { boxlength.z = 128; } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_CAN_WITHER)) + if (sceneryEntry->HasFlag(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; } } - 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()); + 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) { 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, 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); } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_GLASS)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_GLASS)) { if (marker == 0) { // 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, @@ -173,13 +176,13 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co } } - 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; @@ -191,7 +194,7 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co 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; @@ -221,7 +224,7 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co 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; @@ -264,7 +267,7 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co 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; @@ -280,14 +283,14 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co 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)); - frame += tileElement->AsSmallScenery()->GetSceneryQuadrant() << 2; + frame += sceneryElement.GetSceneryQuadrant() << 2; } // 6E0222: uint16_t delay = sceneryEntry->animation_delay & 0xFF; @@ -299,31 +302,31 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co 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()); + 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) { 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, 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); } else { @@ -335,9 +338,9 @@ 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))) + if (!(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_SUPPORTS))) { int32_t ax = 0; int32_t supportHeight = height; @@ -347,9 +350,9 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co 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()); + supportImageColourFlags = SPRITE_ID_PALETTE_COLOUR_1(sceneryElement.GetPrimaryColour()); } if (marker != 0) { @@ -357,11 +360,11 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co } 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); } } } @@ -370,40 +373,40 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co 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 = (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; } 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 = (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 d25d25f660..5cdecc095b 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" @@ -27,19 +28,15 @@ #include "../../sprites.h" #include "../../world/Entity.h" #include "../../world/Surface.h" +#include "../../world/TileInspector.h" #include "Paint.TileElement.h" #include #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 @@ -48,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 @@ -86,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 }, @@ -128,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] = { @@ -201,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; @@ -225,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, @@ -247,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, @@ -260,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, @@ -273,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, @@ -286,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) { @@ -421,9 +430,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; @@ -949,7 +958,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); } } } @@ -960,23 +969,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, { @@ -1009,8 +1019,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]; @@ -1036,7 +1045,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c 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; @@ -1057,7 +1066,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; } } @@ -1075,6 +1084,11 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c imageId |= 0x41880000; } + if (OpenRCT2::TileInspector::IsElementSelected(elementPtr)) + { + imageId |= CONSTRUCTION_MARKER; + } + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, -1 }); has_surface = true; } @@ -1112,8 +1126,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; @@ -1132,7 +1145,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c { 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; @@ -1144,12 +1157,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; @@ -1159,14 +1172,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 }); @@ -1220,8 +1233,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; @@ -1274,7 +1286,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); @@ -1288,7 +1300,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) @@ -1317,7 +1329,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( @@ -1331,12 +1343,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 = Numerics::rol4(tileElement.GetParkFences(), rotation); for (const auto& fenceData : _tileSurfaceBoundaries) { 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/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index cd7626c086..8591e590b6 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" @@ -22,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" @@ -132,7 +134,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; @@ -145,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) @@ -181,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 @@ -209,11 +207,7 @@ 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) + if (screenMinY - (max_height + 32) >= dpi->y + dpi->height) return; session->SpritePosition.x = x; @@ -236,7 +230,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 +264,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: @@ -405,8 +399,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) { @@ -427,7 +422,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/paint/tile_element/Paint.TileElement.h b/src/openrct2/paint/tile_element/Paint.TileElement.h index 3de26c34d4..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" @@ -103,15 +102,13 @@ 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); - -#endif diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index fc66fae338..6b98e5f20a 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" @@ -39,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_) @@ -58,17 +59,13 @@ static void fence_paint_door( { 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); + 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), boundsR2.x, boundsR2.y, - static_cast(boundsR2.z), offset.z, boundsR2_.x, boundsR2_.y, boundsR2_.z); + ps = PaintAddImageAsParent(session, imageId + 1, offset, boundsR2, boundsR2_); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; @@ -78,9 +75,7 @@ static void fence_paint_door( { 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); + ps = PaintAddImageAsParent(session, imageId, offset, boundsL1, boundsL1_); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; @@ -96,7 +91,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) @@ -116,9 +111,7 @@ static void fence_paint_wall( imageId = (imageId & 0x7FFFF) | dword_141F710; } - 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); + PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); if (dword_141F710 == 0) { imageId = baseImageId + dword_141F718; @@ -139,9 +132,7 @@ static void fence_paint_wall( imageId = (imageId & 0x7FFFF) | dword_141F710; } - 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); + paint_struct* paint = PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); if (paint != nullptr) { paint->tertiary_colour = tertiaryColour; @@ -154,11 +145,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; @@ -170,39 +161,43 @@ 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(reinterpret_cast(&wallElement))) + { + dword_141F710 = CONSTRUCTION_MARKER; + } // Save tile_element @@ -212,9 +207,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) @@ -232,7 +227,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; @@ -250,7 +245,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; @@ -268,7 +263,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; @@ -286,7 +281,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; @@ -301,11 +296,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; } @@ -320,11 +315,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; } @@ -354,11 +349,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; } @@ -378,11 +373,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; } @@ -397,7 +392,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); @@ -411,7 +406,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; @@ -431,8 +426,8 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons return; } - auto banner = tile_element->AsWall()->GetBanner(); - if (banner != nullptr && !banner->IsNull()) + auto banner = wallElement.GetBanner(); + if (banner != nullptr) { auto ft = Formatter(); banner->FormatTextTo(ft); diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 828082215b..f9b3297fbd 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -7,12 +7,15 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "Guest.h" + #include "../Context.h" #include "../Game.h" #include "../OpenRCT2.h" #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" @@ -29,7 +32,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" @@ -45,6 +48,7 @@ #include "../world/TileElementsView.h" #include "GuestPathfinding.h" #include "Peep.h" +#include "RideUseSystem.h" #include "Staff.h" #include @@ -161,7 +165,10 @@ static constexpr const CoordsXY _WatchingPositionOffsets[] = { }; static constexpr const ride_rating NauseaMaximumThresholds[] = { - 300, 600, 800, 1000 + 300, + 600, + 800, + 1000, }; /** rct2: 009823AC */ @@ -208,8 +215,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 @@ -404,9 +412,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); @@ -428,7 +438,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; } @@ -446,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)) @@ -454,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) @@ -526,27 +539,27 @@ 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) { - if (scenario_rand() <= 1456) + if ((scenario_rand() & 0xFFFF) <= 1456) { if (IsActionInterruptable()) { @@ -888,7 +901,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); } } @@ -896,7 +909,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 }); @@ -904,10 +917,8 @@ void Guest::Tick128UpdateGuest(int32_t index) Remove(); return; } - else - { - PeepFlags &= ~PEEP_FLAGS_EXPLODE; - } + + PeepFlags &= ~PEEP_FLAGS_EXPLODE; } if (PeepFlags & PEEP_FLAGS_HUNGER) @@ -949,7 +960,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); } } @@ -964,7 +975,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) @@ -989,7 +1000,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) @@ -1069,7 +1080,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) { @@ -1105,7 +1116,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); } } @@ -1237,7 +1248,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); @@ -1378,7 +1389,7 @@ void Guest::CheckIfLost() return; TimeLost = 230; } - InsertNewThought(PeepThoughtType::Lost, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::Lost); HappinessTarget = std::max(HappinessTarget - 30, 0); } @@ -1407,7 +1418,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); } @@ -1428,7 +1439,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); } @@ -1476,7 +1487,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; } @@ -1494,13 +1506,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; } @@ -1516,7 +1528,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) @@ -1763,13 +1775,15 @@ 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) { - OpenRCT2::Audio::Play3D(laughs[laughType], { x, y, z }); + OpenRCT2::Audio::Play3D(laughs[laughType], GetLocation()); } } @@ -1821,7 +1835,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)) { @@ -1852,7 +1867,7 @@ std::bitset Guest::FindRidesToGoOn() { if (!HasRidden(&ride)) { - rideConsideration[ride.id] = true; + rideConsideration[EnumValue(ride.id)] = true; } } } @@ -1873,7 +1888,7 @@ std::bitset Guest::FindRidesToGoOn() for (auto* trackElement : TileElementsView(location)) { auto rideIndex = trackElement->GetRideIndex(); - rideConsideration[rideIndex] = true; + rideConsideration[EnumValue(rideIndex)] = true; } } } @@ -1883,7 +1898,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; } } } @@ -1990,7 +2005,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 { @@ -2234,7 +2249,7 @@ bool Guest::ShouldGoToShop(Ride* ride, bool peepAtShop) { if (CashInPocket <= 0) { - InsertNewThought(PeepThoughtType::SpentMoney, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::SpentMoney); } else { @@ -2287,36 +2302,39 @@ 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) { - 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) @@ -2456,7 +2474,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; @@ -2580,7 +2598,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; } @@ -3066,7 +3084,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) @@ -3101,7 +3119,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; } } } @@ -3129,18 +3147,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)) { @@ -3228,7 +3246,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; @@ -3238,7 +3256,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; @@ -3405,7 +3423,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) @@ -3413,7 +3431,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 { @@ -3517,17 +3535,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 @@ -3543,19 +3560,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); - Guard::Assert(!entranceLocation.isNull()); + 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. @@ -3564,20 +3581,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; } /** @@ -3594,7 +3612,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) @@ -3620,7 +3638,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() actionZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight; } - MoveTo({ *loc, actionZ }); + MoveTo({ loc.value(), actionZ }); return; } @@ -3628,37 +3646,35 @@ 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) { 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, CurrentRide, ft); - } + News::AddItemToQueue(News::ItemType::Ride, STR_GUESTS_GETTING_STUCK_ON_RIDE, EnumValue(CurrentRide), ft); } - - return; } + + return; } Vehicle* vehicle = GetEntity(ride->vehicles[CurrentTrain]); @@ -3683,7 +3699,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() if (vehicle_type->flags & VEHICLE_ENTRY_FLAG_LOADING_WAYPOINTS) { - peep_update_ride_leave_entrance_waypoints(this, ride); + UpdateRideLeaveEntranceWaypoints(*ride); return; } @@ -3740,7 +3756,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; @@ -3807,7 +3823,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) @@ -3901,7 +3917,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) { @@ -3916,7 +3932,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; @@ -3972,9 +3988,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; @@ -4206,7 +4222,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 }; @@ -4226,8 +4242,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) { @@ -4304,9 +4319,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; } @@ -4325,19 +4340,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) @@ -4364,7 +4379,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 @@ -4388,7 +4403,7 @@ void Guest::UpdateRideApproachVehicleWaypoints() { actionZ = z; } - MoveTo({ *loc, actionZ }); + MoveTo({ loc.value(), actionZ }); return; } @@ -4442,7 +4457,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) @@ -4461,7 +4476,7 @@ void Guest::UpdateRideApproachExitWaypoints() { actionZ = z; } - MoveTo({ *loc, actionZ }); + MoveTo({ loc.value(), actionZ }); return; } @@ -4537,9 +4552,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; } @@ -4553,7 +4568,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) @@ -4670,9 +4686,9 @@ void Guest::UpdateRideOnSpiralSlide() } } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } @@ -4696,9 +4712,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; } @@ -4727,7 +4743,7 @@ void Guest::UpdateRideLeaveSpiralSlide() SetDestination(targetLoc); return; } - waypoint = 3; + // Actually force the final waypoint Var37 |= 3; @@ -4769,9 +4785,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; } @@ -4891,9 +4907,9 @@ void Guest::UpdateRideMazePathfinding() break; } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } } @@ -4906,11 +4922,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; } @@ -4955,9 +4971,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; } @@ -5003,7 +5019,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; @@ -5021,13 +5037,15 @@ void Guest::UpdateRideShopInteract() */ void Guest::UpdateRideShopLeave() { - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + const auto curLoc = GetLocation(); + MoveTo({ loc.value(), curLoc.z }); - if ((x & 0xFFE0) != NextLoc.x) + const auto newLoc = GetLocation().ToTileStart(); + if (newLoc.x != NextLoc.x) return; - if ((y & 0xFFE0) != NextLoc.y) + if (newLoc.y != NextLoc.y) return; } @@ -5234,11 +5252,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); } } } @@ -5260,16 +5279,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) { @@ -5421,11 +5441,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); } } @@ -5571,15 +5591,15 @@ 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); OutsideOfPark = false; - ParkEntryTime = gScenarioTicks; + ParkEntryTime = gCurrentTicks; increment_guests_in_park(); decrement_guests_heading_for_park(); auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); @@ -5602,9 +5622,9 @@ void Guest::UpdateLeavingPark() return; } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } @@ -5996,7 +6016,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--) { @@ -6007,7 +6027,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; } @@ -6770,14 +6790,14 @@ 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)]); 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); @@ -6789,14 +6809,28 @@ void peep_thought_set_format_args(const rct_peep_thought* 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); } } +void Guest::InsertNewThought(PeepThoughtType thought_type) +{ + InsertNewThought(thought_type, PeepThoughtItemNone); +} + +void Guest::InsertNewThought(PeepThoughtType thought_type, ShopItem shopItem) +{ + InsertNewThought(thought_type, static_cast(shopItem)); +} + +void Guest::InsertNewThought(PeepThoughtType thought_type, ride_id_t rideId) +{ + InsertNewThought(thought_type, static_cast(rideId)); +} /** * * rct2: 0x699F5A @@ -6804,7 +6838,7 @@ void peep_thought_set_format_args(const rct_peep_thought* 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()) @@ -6817,7 +6851,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; @@ -6829,13 +6863,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; @@ -7030,10 +7064,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; @@ -7356,3 +7388,107 @@ 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) +{ + 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.rideId != 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 = PeepThoughtItemNone; + } +} 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 9bf83c9a7f..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; @@ -88,7 +89,7 @@ static TileElement* get_banner_on_path(TileElement* path_element) if (bannerElement->IsLastForTile()) return nullptr; - } while (bannerElement++); + } while (bannerElement++ != nullptr); return nullptr; } @@ -276,7 +277,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 +328,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; @@ -700,8 +701,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) @@ -734,7 +734,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; @@ -1076,7 +1076,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 +1103,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 +1142,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 +1159,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--; @@ -1282,7 +1276,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 @@ -1334,7 +1328,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 +1347,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 +1395,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 +1459,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 +1582,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 +1606,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 @@ -1678,8 +1670,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); } /** @@ -1733,8 +1725,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); } /** @@ -1791,8 +1783,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); } /** @@ -1806,7 +1798,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) { @@ -1854,7 +1846,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; @@ -2104,8 +2096,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: @@ -2194,7 +2186,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++; @@ -2312,9 +2304,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.cpp b/src/openrct2/peep/Peep.cpp index 6e7fff074e..4666fb0db8 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" @@ -74,12 +75,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,21 +113,16 @@ 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 SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::Guest || Type == EntityType::Staff; } @@ -313,17 +308,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; } /* @@ -374,7 +368,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() { @@ -474,14 +473,17 @@ 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 }; + 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 } }; } @@ -574,13 +576,15 @@ 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) - return std::make_unique(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); + if (tileElement == nullptr) + { + return std::make_unique( + GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + } // Set the coordinate of destination to be exactly // in the middle of a tile. @@ -588,20 +592,18 @@ 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_LAND_NOT_OWNED_BY_PARK); } 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 && stringId != STR_FOOTPATH_IN_THE_WAY) { - if (res->ErrorMessage.GetStringId() != STR_FOOTPATH_IN_THE_WAY) - { - return std::make_unique( - GameActions::Status::NoClearance, STR_ERR_CANT_PLACE_PERSON_HERE, res->ErrorMessage.GetStringId(), - res->ErrorMessageArgs.data()); - } + return std::make_unique( + GameActions::Status::NoClearance, STR_ERR_CANT_PLACE_PERSON_HERE, stringId, res->ErrorMessageArgs.data()); } } @@ -653,7 +655,7 @@ void peep_sprite_remove(Peep* peep) } else { - gStaffModes[staff->StaffId] = StaffMode::None; + staff->ClearPatrolArea(); staff_update_greyed_patrol_areas(); News::DisableNewsItems(News::ItemType::Peep, staff->sprite_index); @@ -713,7 +715,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; @@ -752,7 +754,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 +846,7 @@ void Peep::UpdatePicked() auto* guest = As(); if (SubState == 13 && guest != nullptr) { - guest->InsertNewThought(PeepThoughtType::Help, PEEP_THOUGHT_ITEM_NONE); + guest->InsertNewThought(PeepThoughtType::Help); } } @@ -887,8 +889,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; } @@ -1179,15 +1180,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; @@ -1460,6 +1461,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 +1475,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) @@ -1514,17 +1515,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; } @@ -1836,15 +1835,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()); } @@ -1935,7 +1932,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; @@ -1964,7 +1961,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; @@ -1980,7 +1978,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); } @@ -2006,7 +2004,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; @@ -2032,7 +2030,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; @@ -2061,7 +2059,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; @@ -2298,7 +2296,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; @@ -2316,7 +2314,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; } @@ -2360,7 +2358,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 })) { @@ -2458,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/Peep.h b/src/openrct2/peep/Peep.h index a43542e449..866ccdda35 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -7,50 +7,26 @@ * 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" -#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 "../world/SpriteBase.h" #include -#include #include -#define PEEP_MAX_THOUGHTS 5 -#define PEEP_THOUGHT_ITEM_NONE 255 - -#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 { @@ -68,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 @@ -405,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, @@ -479,77 +303,10 @@ 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, -}; - -struct rct_peep_thought -{ - PeepThoughtType type; // 0 - uint8_t item; // 1 - uint8_t freshness; // 2 larger is less fresh - uint8_t fresh_timeout; // 3 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 : SpriteBase +struct Peep : EntityBase { char* Name; CoordsXYZ NextLoc; @@ -612,8 +369,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; @@ -626,18 +383,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; @@ -649,16 +406,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(); @@ -666,262 +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; - 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; - 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, uint8_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); - -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 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); -}; - -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); - -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 { uint8_t sprite_width; // 0x00 @@ -942,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, @@ -982,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(); @@ -1003,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 rct_peep_thought* 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); @@ -1016,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( @@ -1036,5 +489,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/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/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index c981d22b5e..399ec278b6 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -61,19 +61,22 @@ 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; -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::Staff; } @@ -84,12 +87,6 @@ template<> bool SpriteBase::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(); } @@ -120,12 +117,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); @@ -141,23 +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) { - int32_t staffPatrolOffset = (staff_type + STAFF_MAX_COUNT) * STAFF_PATROL_AREA_SIZE; - for (int32_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 (static_cast(peep->AssignedStaffType) == staff_type) + if (EnumValue(staff->AssignedStaffType) != staffType) { - int32_t peepPatrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE; - for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) - { - gStaffPatrolAreas[staffPatrolOffset + i] |= gStaffPatrolAreas[peepPatrolOffset + i]; - } + continue; + } + if (!staff->HasPatrolArea()) + { + continue; + } + + auto staffData = staff->PatrolInfo->Data; + for (size_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) + { + mergedData[i] |= staffData[i]; } } } @@ -174,7 +176,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); @@ -364,39 +366,46 @@ 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 }; -} - -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); + 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 }; } 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_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; + 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); @@ -407,11 +416,19 @@ 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; - auto [offset, bitIndex] = getPatrolAreaOffsetIndex(coords); - gStaffPatrolAreas[peepOffset + offset] ^= (1 << bitIndex); + delete PatrolInfo; + PatrolInfo = nullptr; +} + +bool Staff::HasPatrolArea() const +{ + 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); } /** @@ -712,7 +729,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 +810,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); } @@ -1150,10 +1167,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; } @@ -1237,7 +1254,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); @@ -1344,14 +1361,14 @@ 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; } - 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; } @@ -1380,7 +1397,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 +1452,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; } @@ -1453,7 +1470,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 +1479,7 @@ void Staff::UpdateHeadingToInspect() newZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight; } - MoveTo({ *loc, newZ }); + MoveTo({ loc.value(), newZ }); return; } @@ -1495,7 +1512,7 @@ void Staff::UpdateAnswering() peep_window_state_update(this); return; } - else if (SubState == 1) + if (SubState == 1) { if (IsActionWalking()) { @@ -1509,7 +1526,7 @@ void Staff::UpdateAnswering() Invalidate(); return; } - else if (SubState <= 3) + if (SubState <= 3) { MechanicTimeSinceCall++; if (MechanicTimeSinceCall > 2500) @@ -1542,7 +1559,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; } @@ -1562,7 +1579,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 +1588,7 @@ void Staff::UpdateAnswering() newZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight; } - MoveTo({ *loc, newZ }); + MoveTo({ loc.value(), newZ }); return; } @@ -1624,7 +1641,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; } @@ -1989,7 +2006,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 @@ -2155,9 +2172,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; } @@ -2275,7 +2292,7 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, const Ride* ride) } auto stationPos = ride->stations[CurrentRideStation].GetStart(); - if (stationPos.isNull()) + if (stationPos.IsNull()) { return true; } @@ -2305,9 +2322,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; } @@ -2361,7 +2378,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, const Ride* ride) } auto stationPosition = ride->stations[CurrentRideStation].GetStart(); - if (stationPosition.isNull()) + if (stationPosition.IsNull()) { return true; } @@ -2411,9 +2428,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; } @@ -2489,7 +2506,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; @@ -2505,11 +2522,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; } @@ -2524,15 +2541,13 @@ 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 - { - return true; - } + + return true; } /** @@ -2587,11 +2602,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; @@ -2608,7 +2623,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 +2632,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/peep/Staff.h b/src/openrct2/peep/Staff.h index 245af03882..8b72ea2a15 100644 --- a/src/openrct2/peep/Staff.h +++ b/src/openrct2/peep/Staff.h @@ -7,24 +7,121 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _STAFF_H_ -#define _STAFF_H_ +#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. -#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 +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 +151,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; @@ -66,8 +161,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(); @@ -76,4 +169,4 @@ int32_t staff_get_available_entertainer_costume_list(EntertainerCostume* costume money32 GetStaffWage(StaffType type); PeepSpriteType EntertainerCostumeToSprite(EntertainerCostume entertainerType); -#endif +const PatrolArea& GetMergedPatrolArea(const StaffType type); diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index 0f311fee91..1781a4bccc 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. @@ -69,6 +73,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) { @@ -80,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; @@ -318,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::USER, DIRID::CRASH); + + auto result = String::ToWideChar(crashPath); return result; } 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/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.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/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/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 580662bb31..04c70360e1 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() @@ -198,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(), @@ -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/platform/platform.h b/src/openrct2/platform/platform.h index e0fb88d3fe..af85318121 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" @@ -97,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(); @@ -167,5 +165,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 87e20d2334..3fdf059ee0 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -7,11 +7,9 @@ * 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" #include "../management/Research.h" #include "../rct12/RCT12.h" #include "../ride/Ride.h" @@ -19,1275 +17,1275 @@ #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; +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; -struct ParkLoadResult; + enum class RideType : uint8_t + { + 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, + + Count, + Null = 255, + }; #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 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(Entrance, 7); + + /** + * RCT1 ride structure + * size: 0x260 + */ + struct Ride { - RatingTuple ratings; + RideType 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 var_C8; - 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(Ride, 0x260); + + struct UnkEntity : 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 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]; + uint32_t animationState; + 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 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(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 Entity { - uint8_t staff_id; // 0xC5 - RCT12RideId guest_heading_to_ride_id; // 0xC5 + uint8_t pad_00[0x100]; + UnkEntity unknown; + Vehicle vehicle; + 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(Entity, 0x100); + + struct ResearchItem { - 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(ResearchItem, 5); + + /** + * RCT1,AA,LL scenario / saved game structure. + * size: 0x1F850C + */ + struct 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; + Entity 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; + 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; + ResearchItem 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; + 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; + 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(S4, 0x1F850C); + + /** + * Track design structure. Only for base RCT1 + * size: 0x2006 + */ + struct 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]; - uint32_t 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; + RideType 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(TD4, 0x38); + + /** + * Track design structure for Added Attractions / Loopy Landscapes + * size: 0x2006 + */ + struct TD4AA : public 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(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, + 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_RIDE_TYPE_COUNT -}; + RCT1_VEHICLE_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_TRACK_ELEM_BOOSTER = 100 + }; - RCT1_VEHICLE_TYPE_COUNT -}; + enum + { + RCT1_RIDE_MODE_REVERSE_INCLINE_LAUNCHED_SHUTTLE = 2, + RCT1_RIDE_MODE_POWERED_LAUNCH = 3, + }; -enum -{ - RCT1_TRACK_ELEM_BOOSTER = 100 -}; + enum + { + RCT1_RIDE_DEPART_PLAY_MUSIC = 1 << 5, + }; -enum -{ - RCT1_RIDE_MODE_REVERSE_INCLINE_LAUNCHED_SHUTTLE = 2, - RCT1_RIDE_MODE_POWERED_LAUNCH = 3, -}; + 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_RIDE_DEPART_PLAY_MUSIC = 1 << 5, -}; + enum + { + RCT1_FOOTPATH_TYPE_QUEUE_BLUE, + RCT1_FOOTPATH_TYPE_QUEUE_RED, + RCT1_FOOTPATH_TYPE_QUEUE_YELLOW, + RCT1_FOOTPATH_TYPE_QUEUE_GREEN, -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, -}; + RCT1_FOOTPATH_TYPE_TARMAC_GRAY, + RCT1_FOOTPATH_TYPE_TARMAC_RED, + RCT1_FOOTPATH_TYPE_TARMAC_BROWN, + RCT1_FOOTPATH_TYPE_TARMAC_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_DIRT_RED, + RCT1_FOOTPATH_TYPE_DIRT_BLACK, - RCT1_FOOTPATH_TYPE_TARMAC_GRAY, - RCT1_FOOTPATH_TYPE_TARMAC_RED, - RCT1_FOOTPATH_TYPE_TARMAC_BROWN, - RCT1_FOOTPATH_TYPE_TARMAC_GREEN, + RCT1_FOOTPATH_TYPE_CRAZY_PAVING = 12, - RCT1_FOOTPATH_TYPE_DIRT_RED, - RCT1_FOOTPATH_TYPE_DIRT_BLACK, + RCT1_FOOTPATH_TYPE_ROADS = 16, - RCT1_FOOTPATH_TYPE_CRAZY_PAVING = 12, + RCT1_FOOTPATH_TYPE_TILE_PINK = 20, + RCT1_FOOTPATH_TYPE_TILE_GRAY, + RCT1_FOOTPATH_TYPE_TILE_RED, + RCT1_FOOTPATH_TYPE_TILE_GREEN, + }; - RCT1_FOOTPATH_TYPE_ROADS = 16, + enum + { + FOOTPATH_SUPPORTS_WOODEN_TRUSS, + FOOTPATH_SUPPORTS_WOOD, + FOOTPATH_SUPPORTS_STEEL, + FOOTPATH_SUPPORTS_BAMBOO, + }; - RCT1_FOOTPATH_TYPE_TILE_PINK = 20, - RCT1_FOOTPATH_TYPE_TILE_GRAY, - RCT1_FOOTPATH_TYPE_TILE_RED, - RCT1_FOOTPATH_TYPE_TILE_GREEN, -}; + 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 -{ - FOOTPATH_SUPPORTS_WOODEN_TRUSS, - FOOTPATH_SUPPORTS_WOOD, - FOOTPATH_SUPPORTS_STEEL, - FOOTPATH_SUPPORTS_BAMBOO, -}; + 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_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_RESEARCH_END_AVAILABLE = 0xFF, + RCT1_RESEARCH_END_RESEARCHABLE = 0xFE, + RCT1_RESEARCH_END = 0xFD, + }; -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_TYPE_THEME, + RCT1_RESEARCH_TYPE_RIDE, + RCT1_RESEARCH_TYPE_VEHICLE, + RCT1_RESEARCH_TYPE_SPECIAL, + }; -enum -{ - RCT1_RESEARCH_END_AVAILABLE = 0xFF, - RCT1_RESEARCH_END_RESEARCHABLE = 0xFE, - RCT1_RESEARCH_END = 0xFD, -}; + 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_TYPE_THEME, - RCT1_RESEARCH_TYPE_RIDE, - RCT1_RESEARCH_TYPE_VEHICLE, - RCT1_RESEARCH_TYPE_SPECIAL, -}; + // 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_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_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, + }; -// 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_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_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 + { + 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 -{ - 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 + { + COPY_COLOUR_1 = -1, + COPY_COLOUR_2 = -2, + }; -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 + { + RCT1_WATER_CYAN, + RCT1_WATER_ORANGE + }; -enum -{ - COPY_COLOUR_1 = -1, - COPY_COLOUR_2 = -2, -}; + enum + { + RCT1_SCENERY_TULIPS_1 = 65, + RCT1_SCENERY_TULIPS_2 = 68, -enum -{ - RCT1_WATER_CYAN, - RCT1_WATER_ORANGE -}; + 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 -enum -{ - RCT1_SCENERY_TULIPS_1 = 65, - RCT1_SCENERY_TULIPS_2 = 68, + RCT1_SCENERY_SMALL_RED_GARDENS = 176, // TG19 + }; - 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 + enum + { + RCT1_LANDSCAPE_DOOR_CLOSED = 0, + RCT1_LANDSCAPE_DOOR_HALF_OPEN = 2, + RCT1_LANDSCAPE_DOOR_OPEN = 3, + }; - RCT1_SCENERY_SMALL_RED_GARDENS = 176, // TG19 -}; + enum + { + RCT1_PATH_SUPPORT_TYPE_TRUSS, + RCT1_PATH_SUPPORT_TYPE_COATED_WOOD, + RCT1_PATH_SUPPORT_TYPE_SPACE, + RCT1_PATH_SUPPORT_TYPE_BAMBOO, + }; -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, -}; + 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); - -#endif diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index d5e96e1f2f..73df5ffe9a 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -28,11 +28,13 @@ #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" #include "../object/ObjectRepository.h" #include "../peep/Peep.h" +#include "../peep/RideUseSystem.h" #include "../peep/Staff.h" #include "../ride/RideData.h" #include "../ride/Station.h" @@ -74,2993 +76,2984 @@ 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 _entries.size(); } - return static_cast(entryIndex); - } - void AddRange(std::initializer_list initializerList) + const std::vector& GetEntries() const + { + return _entries; + } + + ObjectEntryIndex GetOrAddEntry(const char* entryName) + { + auto entryIndex = Collections::IndexOf(_entries, entryName, true); + if (entryIndex == SIZE_MAX) + { + 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 { - for (auto entry : initializerList) + private: + std::string _s4Path; + 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[EnumValue(RideType::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 { - GetOrAddEntry(entry); - } - } -}; + const utf8* extension = Path::GetExtension(path); + if (String::Equals(extension, ".sc4", true)) + { + return LoadScenario(path); + } + if (String::Equals(extension, ".sv4", true)) + { + return LoadSavedGame(path); + } -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) + ParkLoadResult LoadSavedGame(const utf8* path, bool skipObjectCheck = false) override { - dst->objective_arg_3 = GetBuildTheBestRideId(); + auto fs = FileStream(path, FILE_MODE_OPEN); + auto result = LoadFromStream(&fs, false, skipObjectCheck, path); + return result; } - 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) + ParkLoadResult LoadScenario(const utf8* path, bool skipObjectCheck = false) override { - desc.title = name.c_str(); + auto fs = FileStream(path, FILE_MODE_OPEN); + auto result = LoadFromStream(&fs, true, skipObjectCheck, path); + return result; } - 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)) + ParkLoadResult LoadFromStream( + IStream* stream, bool isScenario, [[maybe_unused]] bool skipObjectCheck, const utf8* path) override { - if (localisedStringIds[0] != STR_NONE) + _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) { - name = String::ToStd(language_get_string(localisedStringIds[0])); + dst->objective_arg_3 = GetBuildTheBestRideId(); } - if (localisedStringIds[2] != STR_NONE) + + 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) { - details = String::ToStd(language_get_string(localisedStringIds[2])); + desc.title = name.c_str(); } - } - String::Set(dst->name, sizeof(dst->name), name.c_str()); - String::Set(dst->details, sizeof(dst->details), details.c_str()); + String::Set(dst->internal_name, sizeof(dst->internal_name), desc.title); - return true; - } - - int32_t CorrectRCT1ParkValue(money32 oldParkValue) - { - if (oldParkValue == MONEY32_UNDEFINED) - { - return MONEY32_UNDEFINED; - } - - if (_parkValueConversionFactor == 0) - { - if (_s4.park_value != 0) + rct_string_id localisedStringIds[3]; + if (language_get_localised_scenario_strings(desc.title, localisedStringIds)) { - // 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; + if (localisedStringIds[0] != STR_NONE) + { + name = String::ToStd(language_get_string(localisedStringIds[0])); + } + if (localisedStringIds[2] != STR_NONE) + { + details = String::ToStd(language_get_string(localisedStringIds[2])); + } + } + + 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) + { + if (oldParkValue == MONEY32_UNDEFINED) + { + return MONEY32_UNDEFINED; + } + + if (_parkValueConversionFactor == 0) + { + 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 + { + // 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(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(S4)); } else { - // In new games, the park value isn't set. - _parkValueConversionFactor = 100; + decodedSize = sawyercoding_decode_sv4(data.get(), decodedData.get(), dataSize, sizeof(S4)); } - } - return (oldParkValue * _parkValueConversionFactor) / 10; - } + if (decodedSize == sizeof(S4)) + { + std::memcpy(s4.get(), decodedData.get(), sizeof(S4)); + return s4; + } -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 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); - gS6Info.editor_step = EditorStep::ObjectSelection; - gParkFlags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES; - gS6Info.category = SCENARIO_CATEGORY_OTHER; - } - - std::string GetRCT1ScenarioName() - { - const scenario_index_entry* scenarioEntry = _scenarioRepository->GetByInternalName(_s4.scenario_name); - if (scenarioEntry == nullptr) + void Initialise() { - return ""; + // 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; } - else + + std::string GetRCT1ScenarioName() { + const scenario_index_entry* scenarioEntry = _scenarioRepository->GetByInternalName(_s4.scenario_name); + if (scenarioEntry == nullptr) + { + return ""; + } + return path_get_filename(scenarioEntry->path); } - } - 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++) + void InitialiseEntryMaps() { - 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; - } + 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); } - } - void AddAvailableEntriesFromMap() - { - size_t maxTiles = 128 * 128; - size_t tileIndex = 0; - RCT12TileElement* tileElement = _s4.tile_elements; - - while (tileIndex < maxTiles) + /** + * 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() { - switch (tileElement->GetType()) + 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 ResearchItem* researchList = GetResearchList(&researchListCount); + std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( + researchList, researchListCount); + for (size_t i = 0; i < researchListCount; i++) { - case TILE_ELEMENT_TYPE_PATH: - { - uint8_t pathType = tileElement->AsPath()->GetRCT1PathType(); - uint8_t pathAdditionsType = tileElement->AsPath()->GetAddition(); + const ResearchItem* researchItem = &researchList[i]; - 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: + if (researchItem->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) { - for (int32_t edge = 0; edge < 4; edge++) + if (researchItem->item == RCT1_RESEARCH_END) { - int32_t type = tileElement->AsWall()->GetRCT1WallType(edge); + break; + } + if (researchItem->item == RCT1_RESEARCH_END_AVAILABLE + || researchItem->item == RCT1_RESEARCH_END_RESEARCHABLE) + { + continue; + } + } - if (type != -1) + switch (researchItem->type) + { + case RCT1_RESEARCH_TYPE_THEME: + AddEntriesForSceneryTheme(researchItem->item); + break; + case RCT1_RESEARCH_TYPE_RIDE: + 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) { - AddEntryForWall(type); + AddEntryForVehicleType(static_cast(researchItem->related_ride), researchItem->item); } - } - break; + break; } } - - if ((tileElement++)->IsLastForTile()) - { - tileIndex++; - } } - } - void AddAvailableEntriesFromRides() - { - for (size_t i = 0; i < std::size(_s4.rides); i++) + void AddAvailableEntriesFromMap() { - 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); - } - } - } + size_t maxTiles = RCT1_MAX_MAP_SIZE * RCT1_MAX_MAP_SIZE; + size_t tileIndex = 0; + RCT12TileElement* tileElement = _s4.tile_elements; - 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) + while (tileIndex < maxTiles) { - auto& objectRepository = OpenRCT2::GetContext()->GetObjectRepository(); - auto foundObject = objectRepository.FindObjectLegacy(objectName); - if (foundObject != nullptr) + switch (tileElement->GetType()) { - ObjectType objectType = foundObject->ObjectEntry.GetType(); - switch (objectType) + case TILE_ELEMENT_TYPE_PATH: { - case ObjectType::SmallScenery: - case ObjectType::LargeScenery: - case ObjectType::Walls: - case ObjectType::Paths: - case ObjectType::PathBits: - { - EntryList* entries = GetEntryList(objectType); + uint8_t pathType = tileElement->AsPath()->GetRCT1PathType(); + uint8_t pathAdditionsType = tileElement->AsPath()->GetAddition(); - // Check if there are spare entries available - size_t maxEntries = static_cast(object_entry_group_counts[EnumValue(objectType)]); - if (entries != nullptr && entries->GetCount() < maxEntries) + 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; } - default: - // This switch processes only ObjectTypes valid for scenery - 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 != RideType::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; + } } } } } - } - 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); + } + + _waterEntry.GetOrAddEntry(entryName); + } + + void AddEntryForRideType(RideType rideType) + { + 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[EnumValue(rideType)] = entryIndex; + } } } - } - void ImportRides() - { - for (int32_t i = 0; i < RCT12_MAX_RIDES_IN_PARK; i++) + void AddEntryForVehicleType(RideType rideType, uint8_t vehicleType) { - if (_s4.rides[i].type != RIDE_TYPE_NULL) + Guard::Assert(EnumValue(rideType) < std::size(_rideTypeToRideEntryMap)); + + if (_vehicleTypeToRideEntryMap[vehicleType] == OBJECT_ENTRY_INDEX_NULL) { - ImportRide(GetOrAllocateRide(i), &_s4.rides[i], i); + const char* entryName = RCT1::GetVehicleObject(vehicleType); + if (!String::Equals(entryName, " ")) + { + auto entryIndex = _rideEntries.GetOrAddEntry(entryName); + _vehicleTypeToRideEntryMap[vehicleType] = entryIndex; + + if (rideType != RideType::Null) + AddEntryForRideType(rideType); + } } } - } - 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) + void AddEntryForSmallScenery(ObjectEntryIndex smallSceneryType) { - 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()) + assert(smallSceneryType < std::size(_smallSceneryTypeToEntryMap)); + if (_smallSceneryTypeToEntryMap[smallSceneryType] == OBJECT_ENTRY_INDEX_NULL) { - dst->stations[i].Start.setNull(); + 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 { - auto tileStartLoc = TileCoordsXY{ src->station_starts[i].x, src->station_starts[i].y }; - dst->stations[i].Start = tileStartLoc.ToCoordsXY(); + 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; + } } - 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]; + void ImportRides() + { + for (int32_t i = 0; i < RCT12_MAX_RIDES_IN_PARK; i++) + { + if (_s4.rides[i].type != RideType::Null) + { + const auto rideId = static_cast(i); + ImportRide(GetOrAllocateRide(rideId), &_s4.rides[i], rideId); + } + } + } - // Direction is fixed later. - if (src->entrance[i].isNull()) + 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 == RideType::InvertedRollerCoaster) + { + 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[EnumValue(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(); + 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; + + dst->music = OBJECT_ENTRY_INDEX_NULL; + if (GetRideTypeDescriptor(dst->type).HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) + { + if (_gameVersion == FILE_VERSION_RCT1) + { + // Original RCT had no music settings, take default style + auto style = GetStyleFromMusicIdentifier(GetRideTypeDescriptor(dst->type).DefaultMusic); + if (style.has_value()) + { + dst->music = style.value(); + } + + // 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::MerryGoRound || src->type == RideType::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; + } + } + + if (src->operating_mode == RCT1_RIDE_MODE_POWERED_LAUNCH) + { + // Launched rides never passed through the station in RCT1. + dst->mode = RideMode::PoweredLaunch; + } 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->mode = static_cast(src->operating_mode); } - } - 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); - 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; - // 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; - // 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_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 = src->income_per_hour; - dst->total_customers = src->total_customers; - dst->profit = src->profit; - dst->total_profit = 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) - { - 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; + 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->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) + 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++) { - auto ride = get_ride(RCT12RideIdToOpenRCT2RideId(src.ride_index)); - if (ride != nullptr) + 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 == RideType::BalloonStall) { - ride->measurement = std::make_unique(); - ImportRideMeasurement(*ride->measurement, src); + dst->track_colour[0].main = COLOUR_LIGHT_BLUE; + } + else if (src->type == RideType::RiverRapids) + { + 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 + 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); + } + 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) + { + const auto& srcRide = _s4.rides[src->ride]; + uint8_t vehicleTypeIndex = srcRide.vehicle_type; + RCT1::VehicleColourSchemeCopyDescriptor 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() + { + // 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, 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. + // - 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 = 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 = _s4.cash; - gBankLoan = _s4.loan; - gMaxBankLoan = _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; - - gCompanyValue = _s4.company_value; - gParkValue = 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]); - gWeeklyProfitHistory[i] = _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] = _s4.expenditure[i][j]; - } - } - gCurrentExpenditure = _s4.total_expenditure; - - gScenarioCompletedCompanyValue = _s4.completed_company_value; - gTotalAdmissions = _s4.num_admissions; - gTotalIncomeFromAdmissions = _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) + // 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; + staffmember->SetPatrolArea({ x, y }, true); + } + } + } + + void ImportEntityCommonProperties(EntityBase* 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) + { + 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); + } + } + + ObjectList 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); + + ObjectList objectList; + for (rct_object_entry entry : result) + { + objectList.Add(ObjectEntryDescriptor(entry)); + } + + return objectList; + } + + 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 + { + 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->SetLegacyPathEntryIndex(entryIndex); + dst2->SetShouldDrawPathOverSupports(true); + if (RCT1::PathIsQueue(pathType)) + { + dst2->SetIsQueue(true); + } + // TODO: Set railings type + + // 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->SetRideType(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->SetLegacyPathEntryIndex(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; - // 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()); + colour_t colourA = RCT1::GetColour(src2->GetRCT1WallColour()); + colour_t colourB = COLOUR_BLACK; + colour_t colourC = COLOUR_BLACK; + ConvertWall(type, &colourA, &colourB); - // Set last element flag in case the original last element was never added - if (tileElements.size() > 0) - { - tileElements.back().SetLastForTile(true); + 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; } - 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) + void ImportResearch() { - case TILE_ELEMENT_TYPE_SURFACE: + // 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::ResearchItem* 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++) { - 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; + research_insert_scenery_group_entry(i, true); } - case TILE_ELEMENT_TYPE_PATH: + + bool researched = true; + auto rideTypeInResearch = GetRideTypesPresentInResearchList(researchList, researchListCount); + std::vector vehiclesWithMissingRideTypes; + for (size_t i = 0; i < researchListCount; i++) { - 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)) + const auto& researchItem = researchList[i]; + if (researchItem.flags == RCT1_RESEARCH_FLAGS_SEPARATOR) { - dst2->SetIsQueue(true); - } - if (_gameVersion != FILE_VERSION_RCT1_LL) - { - dst2->SetRailingEntryIndex(0); - } - else - { - ObjectEntryIndex railingsEntryIndex; - switch (src2->GetRCT1SupportType()) + if (researchItem.item == RCT1_RESEARCH_END_AVAILABLE) { - 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) + researched = false; 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) + // We don't import the random items yet. + else if (researchItem.item == RCT1_RESEARCH_END_RESEARCHABLE || researchItem.item == RCT1_RESEARCH_END) { - edgeSlope &= ~EDGE_SLOPE_ELEVATED; - baseZ += LAND_HEIGHT_STEP; - clearanceZ += LAND_HEIGHT_STEP; + break; } - - 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(); - - 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()); - - if (index < std::size(_s4.banners)) + switch (researchItem.type) { - auto srcBanner = &_s4.banners[index]; - auto dstBanner = GetBanner(index); - ImportBanner(dstBanner, srcBanner); - } - 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) + case RCT1_RESEARCH_TYPE_THEME: { - 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++) + uint8_t rct1SceneryTheme = researchItem.item; + auto sceneryGroupEntryIndex = _sceneryThemeTypeToEntryMap[rct1SceneryTheme]; + if (sceneryGroupEntryIndex != OBJECT_ENTRY_INDEX_IGNORE + && sceneryGroupEntryIndex != OBJECT_ENTRY_INDEX_NULL) { - const rct1_research_item* researchItem2 = &researchList[j]; - if (researchItem2->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) + research_insert_scenery_group_entry(sceneryGroupEntryIndex, researched); + } + break; + } + case RCT1_RESEARCH_TYPE_RIDE: + { + const auto rct1RideType = static_cast(researchItem.item); + _researchRideTypeUsed[EnumValue(rct1RideType)] = true; + + auto ownRideEntryIndex = _rideTypeToRideEntryMap[EnumValue(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++) { - if (researchItem2->item == RCT1_RESEARCH_END_RESEARCHABLE - || researchItem2->item == RCT1_RESEARCH_END) + const auto& researchItem2 = researchList[j]; + if (researchItem2.flags == RCT1_RESEARCH_FLAGS_SEPARATOR) { - break; + if (researchItem2.item == RCT1_RESEARCH_END_RESEARCHABLE + || researchItem2.item == RCT1_RESEARCH_END) + { + break; + } + + continue; } - continue; - } - - if (researchItem2->type == RCT1_RESEARCH_TYPE_VEHICLE - && researchItem2->related_ride == rct1RideType) - { - auto rideEntryIndex2 = _vehicleTypeToRideEntryMap[researchItem2->item]; - bool isOwnType = (ownRideEntryIndex == rideEntryIndex2); - if (isOwnType) + if (researchItem2.type == RCT1_RESEARCH_TYPE_VEHICLE + && static_cast(researchItem2.related_ride) == rct1RideType) { - foundOwnType = true; - } + 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); + // 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]) + if (!foundOwnType) { - _researchRideEntryUsed[ownRideEntryIndex] = true; - research_insert_ride_entry(ownRideEntryIndex, researched); + 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]) + break; + } + case RCT1_RESEARCH_TYPE_VEHICLE: { - InsertResearchVehicle(researchItem, researched); + // 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; } - 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; + case RCT1_RESEARCH_TYPE_SPECIAL: + // Not supported + break; } } - - if (researchItem->type == RCT1_RESEARCH_TYPE_RIDE) + for (const auto& researchItem : vehiclesWithMissingRideTypes) { - ret[researchItem->item] = true; + InsertResearchVehicle(researchItem, false); } - } - 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()) + // Research funding / priority + uint8_t activeResearchTypes = 0; + if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_ROLLERCOASTERS) { - parkName = userString; + activeResearchTypes |= EnumToFlag(ResearchCategory::Rollercoaster); } - } - - 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) + if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_THRILL_RIDES) { - uint8_t researchItem = src->Assoc & 0x000000FF; - uint8_t researchType = (src->Assoc & 0x00FF0000) >> 16; + 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; - ResearchItem tmpResearchItem = {}; - ConvertResearchEntry(&tmpResearchItem, researchItem, researchType); - dst->Assoc = tmpResearchItem.rawValue; + // 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 { - dst->Assoc = src->Assoc; + ::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; } } - // 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)) + static std::bitset GetRideTypesPresentInResearchList( + const RCT1::ResearchItem* researchList, size_t researchListCount) { - gParkFlags |= PARK_FLAGS_UNLOCK_ALL_PRICES; - } + std::bitset ret = {}; - // 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) + for (size_t i = 0; i < researchListCount; i++) { - rct_ride_entry* rideEntry = get_ride_entry(entryIndex); - - if (rideEntry != nullptr) + const auto& researchItem = researchList[i]; + if (researchItem.flags == RCT1_RESEARCH_FLAGS_SEPARATOR) { - 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 (researchItem.item == RCT1_RESEARCH_END_AVAILABLE || researchItem.item == RCT1_RESEARCH_END_RESEARCHABLE) { - name = String::ToStd(language_get_string(localisedStringIds[0])); + continue; } - if (localisedStringIds[2] != STR_NONE) + if (researchItem.item == RCT1_RESEARCH_END) { - details = String::ToStd(language_get_string(localisedStringIds[2])); + break; + } + } + + if (researchItem.type == RCT1_RESEARCH_TYPE_RIDE) + { + ret[researchItem.item] = true; + } + } + + return ret; + } + + void InsertResearchVehicle(const ResearchItem& 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 + gCurrentTicks = _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; + + auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); + park.ResetHistories(); + 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) + { + gGuestsInParkHistory[i] = _s4.guests_in_park_history[i] * RCT12GuestsInParkHistoryFactor; + } + } + + // 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 + { + dst->Assoc = src->Assoc; + } + } + + // 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)) + { + 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) + { + 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_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; + } + } } - String::Set(gS6Info.name, sizeof(gS6Info.name), name.c_str()); - String::Set(gS6Info.details, sizeof(gS6Info.details), details.c_str()); - 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 = CorrectRCT1ParkValue(_s4.scenario_objective_currency); - else - gScenarioObjective.Currency = _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) + void ImportClimate() { - 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; - } - } - - void ImportBanner(Banner* dst, const RCT12Banner* src) - { - *dst = {}; - dst->type = RCTEntryIndexToOpenRCT2EntryIndex(src->type); - - dst->flags = 0; - if (src->flags & BANNER_FLAG_NO_ENTRY) - { - dst->flags |= BANNER_FLAG_NO_ENTRY; + 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); } - if (is_user_string_id(src->string_idx)) + void ImportScenarioNameDetails() { - dst->text = GetUserString(src->string_idx); + 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) + { + name = String::ToStd(language_get_string(localisedStringIds[0])); + } + if (localisedStringIds[2] != STR_NONE) + { + details = String::ToStd(language_get_string(localisedStringIds[2])); + } + } + } + } + + gScenarioName = name; + gScenarioDetails = details; } - 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) + void ImportScenarioObjective() { - TileElement* element = it.element; + gScenarioObjective.Type = _s4.scenario_objective_type; + gScenarioObjective.Year = _s4.scenario_objective_years; + gScenarioObjective.NumGuests = _s4.scenario_objective_num_guests; - if (element->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) - continue; - if (element->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE) - continue; - if ((element->AsEntrance()->GetSequenceIndex()) != 0) - continue; + // 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); - CoordsXYZD entrance = { TileCoordsXY(it.x, it.y).ToCoordsXY(), element->GetBaseZ(), element->GetDirection() }; - gParkEntrances.push_back(entrance); + // 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(); } - } - EntryList* GetEntryList(ObjectType objectType) - { - switch (objectType) + void ImportSavedView() { - 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; + gSavedView = ScreenCoordsXY{ _s4.view_x, _s4.view_y }; + gSavedViewZoom = _s4.view_zoom; + gSavedViewRotation = _s4.view_rotation; } - return nullptr; - } - const rct1_research_item* GetResearchList(size_t* count) - { - // Loopy Landscapes stores research items in a different place - if (_gameVersion == FILE_VERSION_RCT1_LL) + void ConvertWall(const int32_t& type, colour_t* colourA, colour_t* colourB) { - *count = std::size(_s4.research_items_LL); - return _s4.research_items_LL; + switch (type) + { + 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; + } } - else + + void ImportBanner(Banner* dst, const RCT12Banner* src) { + *dst = {}; + dst->type = RCTEntryIndexToOpenRCT2EntryIndex(src->type); + + dst->flags = 0; + if (src->flags & BANNER_FLAG_NO_ENTRY) + { + 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; + 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; + } + + const RCT1::ResearchItem* GetResearchList(size_t* count) + { + // Loopy Landscapes stores research items in a different place + if (_gameVersion == FILE_VERSION_RCT1_LL) + { + *count = std::size(_s4.research_items_LL); + return _s4.research_items_LL; + } + *count = std::size(_s4.research_items); return _s4.research_items; } - } - 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(); - } - - void FixLandOwnership() - { - switch (_s4.scenario_slot_index) + std::string GetUserString(rct_string_id stringId) { - 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; + 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(); } - } - /** - * 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) + void FixLandOwnership() { - // First, make the queuing peep exit - for (auto peep : EntityList()) + switch (_s4.scenario_slot_index) { - if (peep->State == PeepState::QueuingFront && peep->CurrentRide == 0) - { - peep->RemoveFromQueue(); - peep->SetState(PeepState::Falling); + 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; + } + } + + /** + * 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) + { + const auto merryGoRoundId = static_cast(0); + + // First, make the queuing peep exit + for (auto peep : EntityList()) + { + if (peep->State == PeepState::QueuingFront && peep->CurrentRide == merryGoRoundId) + { + peep->RemoveFromQueue(); + peep->SetState(PeepState::Falling); + break; + } + } + + // Now, swap the entrance and exit. + auto ride = get_ride(merryGoRoundId); + 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(); + } + } + } + + /** + * 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() + { + 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 }); + 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()); + } + } + } + + /** + * 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() + { + for (auto& ride : GetRideManager()) + { + if (ride.custom_name.empty()) + { + ride.SetNameToDefault(); + } + } + } + + ObjectEntryIndex GetBuildTheBestRideId() + { + size_t researchListCount; + const RCT1::ResearchItem* researchList = GetResearchList(&researchListCount); + for (size_t i = 0; i < researchListCount; i++) + { + if (researchList[i].flags == 0xFF) + { + break; + } + + if (researchList[i].type == RCT1_RESEARCH_TYPE_RIDE) + { + return RCT1::GetRideType(static_cast(researchList[i].item), 0); } } - // 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(); - } + return RIDE_TYPE_NULL; } - } + }; - /** - * 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() + // Very similar but not the same as S6Importer version (due to peeps) + constexpr EntityType GetEntityTypeFromRCT1Sprite(const RCT12SpriteBase& src) { - for (int32_t x = 0; x < RCT1_MAX_MAP_SIZE; x++) + EntityType output = EntityType::Null; + switch (src.sprite_identifier) { - 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()); - } - } - } - - /** - * 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() - { - for (auto& ride : GetRideManager()) - { - if (ride.custom_name.empty()) - { - ride.SetNameToDefault(); - } - } - } - - ObjectEntryIndex GetBuildTheBestRideId() - { - size_t researchListCount; - const rct1_research_item* researchList = GetResearchList(&researchListCount); - for (size_t i = 0; i < researchListCount; i++) - { - if (researchList[i].flags == 0xFF) - { + 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: - if (researchList[i].type == RCT1_RESEARCH_TYPE_RIDE) - { - return RCT1::GetRideType(researchList[i].item, 0); - } + 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 RIDE_TYPE_NULL; + return output; } -}; -// 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) + template<> void S4Importer::ImportEntity<::Vehicle>(const RCT12SpriteBase& srcBase) { - 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: + auto* dst = CreateEntityAt<::Vehicle>(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + const auto* ride = get_ride(static_cast(src->ride)); + if (ride == nullptr) + return; - 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; -} + uint8_t vehicleEntryIndex = RCT1::GetVehicleSubEntryIndex(src->vehicle_type); -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; + dst->ride = static_cast(src->ride); + dst->ride_subtype = RCTEntryIndexToOpenRCT2EntryIndex(ride->subtype); - uint8_t vehicleEntryIndex = RCT1::GetVehicleSubEntryIndex(src->vehicle_type); + dst->vehicle_type = vehicleEntryIndex; + dst->SubType = ::Vehicle::Type(src->type); + dst->var_44 = src->var_44; + dst->remaining_distance = src->remaining_distance; - dst->ride = src->ride; - dst->ride_subtype = RCTEntryIndexToOpenRCT2EntryIndex(ride->subtype); + // 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->vehicle_type = vehicleEntryIndex; - dst->SubType = Vehicle::Type(src->type); - dst->var_44 = src->var_44; - dst->remaining_distance = src->remaining_distance; + dst->SpriteRect = ScreenRect(src->sprite_left, src->sprite_top, src->sprite_right, src->sprite_bottom); - // 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->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->sprite_left = src->sprite_left; - dst->sprite_top = src->sprite_top; - dst->sprite_right = src->sprite_right; - dst->sprite_bottom = src->sprite_bottom; + 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_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; - 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; + // Seat rotation was not in RCT1 + dst->target_seat_rotation = DEFAULT_SEAT_ROTATION; + dst->seat_rotation = DEFAULT_SEAT_ROTATION; - 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->var_C8 = src->var_C8; - 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; + // 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; - // 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) + // Guests (indexes converted later) + for (int i = 0; i < 32; i++) { - dst->peep_tshirt_colours[i] = RCT1::GetColour(src->peep_tshirt_colours[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<::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) + { + 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); + if (srcThought->item == RCT12PeepThoughtItemNone) + dstThought->item = PeepThoughtItemNone; + else + 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(); } } - Vehicle::Status statusSrc = Vehicle::Status::MovingToEndOfStation; - if (src->status <= static_cast(Vehicle::Status::StoppedByBlockBrakes)) + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { - 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; + 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->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; - SetVehicleColours(dst, src); - - dst->mini_golf_current_animation = 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; - - 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]; + ImportStaffPatrolArea(dst, src->staff_id); } - dst->Photo1RideRef = RCT12RideIdToOpenRCT2RideId(src->photo1_ride_ref); - - for (size_t i = 0; i < std::size(src->thoughts); i++) + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { - 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; + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + ImportEntityCommonProperties(dst, src); + + dst->SubType = Litter::Type(src->type); } - 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) + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { - dst->FavouriteRide = RCT12RideIdToOpenRCT2RideId(src->favourite_ride); - dst->FavouriteRideRating = src->favourite_ride_rating; - } - else - { - dst->FavouriteRide = RIDE_ID_NULL; - dst->FavouriteRideRating = 0; + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + + ImportEntityCommonProperties(dst, src); + dst->frame = src->frame; } - dst->SetItemFlags(src->GetItemFlags()); - - if (dst->OutsideOfPark && dst->State != PeepState::LeavingPark) + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { - increment_guests_heading_for_park(); + 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; } - else + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { - increment_guests_in_park(); + 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); - 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) + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { - dst->colour = COLOUR_LIGHT_BLUE; + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + ImportEntityCommonProperties(dst, src); } - else + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { - dst->colour = RCT1::GetColour(src->colour); + 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->frame = src->frame; - dst->state = static_cast(src->state); -} - -void S4Importer::ImportEntity(const RCT12SpriteBase& src) -{ - switch (GetEntityTypeFromRCT1Sprite(src)) + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { - 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; + 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<::Vehicle>(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()); + objectMgr.LoadObjects(result.RequiredObjects); s4Importer->Import(); } 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()); + objectMgr.LoadObjects(result.RequiredObjects); s4Importer->Import(); } diff --git a/src/openrct2/rct1/T4Importer.cpp b/src/openrct2/rct1/T4Importer.cpp index dc11084497..ba7b2fba32 100644 --- a/src/openrct2/rct1/T4Importer.cpp +++ b/src/openrct2/rct1/T4Importer.cpp @@ -22,274 +22,273 @@ #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 + + bool Load(const utf8* path) override { + const utf8* extension = Path::GetExtension(path); + if (String::Equals(extension, ".td4", true)) + { + _name = GetNameFromTrackPath(path); + auto fs = OpenRCT2::FileStream(path, OpenRCT2::FILE_MODE_OPEN); + return LoadFromStream(&fs); + } + 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) + bool LoadFromStream(OpenRCT2::IStream* stream) override { - throw IOException("Invalid checksum."); + 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; } - 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) + std::unique_ptr Import() override { - throw IOException("Version number incorrect."); - } - _stream.SetPosition(0); + 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) + { + throw IOException("Version number incorrect."); + } + _stream.SetPosition(0); + + if (version == RCT12TrackDesignVersion::TD4_AA) + { + return ImportAA(); + } - 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++) + private: + std::unique_ptr ImportAA() { - 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]); + std::unique_ptr td = std::make_unique(); + TD4AA td4aa{}; + _stream.Read(&td4aa, sizeof(TD4AA)); + + 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); } - 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++) + std::unique_ptr ImportTD4() { - 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) + std::unique_ptr td = std::make_unique(); + TD4 td4{}; + _stream.Read(&td4, sizeof(TD4)); + for (int32_t i = 0; i < NUM_COLOUR_SCHEMES; i++) { - case RCT1_RIDE_TYPE_HEDGE_MAZE: + 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 + if (td4.type == RideType::HedgeMaze) + { td->track_support_colour[i] = MAZE_WALL_TYPE_HEDGE; - break; - case RCT1_RIDE_TYPE_RIVER_RAPIDS: + } + else if (td4.type == RideType::RiverRapids) + { 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); - } - 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->flags2 = 0; + return ImportTD4Base(std::move(td), td4); } - td->name = _name; - return td; - } -}; + std::unique_ptr ImportTD4Base(std::unique_ptr td, 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 == RideType::HedgeMaze) + { + 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))); + } + td->vehicle_object = ObjectEntryDescriptor(vehicleObject); + 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::VehicleColourSchemeCopyDescriptor 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..344535359a 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::SteelTwisterRollerCoaster && 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::SteelCorkscrewRollerCoaster && vehicleType == RCT1_VEHICLE_TYPE_HYPERCOASTER_TRAIN) return RIDE_TYPE_HYPERCOASTER; static uint8_t map[] = @@ -271,13 +271,15 @@ 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]; } - 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, @@ -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::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; @@ -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) @@ -1248,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) @@ -1396,13 +1400,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/rct1/Tables.h b/src/openrct2/rct1/Tables.h index acb0db2006..6667e61eac 100644 --- a/src/openrct2/rct1/Tables.h +++ b/src/openrct2/rct1/Tables.h @@ -16,24 +16,26 @@ namespace RCT1 { - struct RCT1VehicleColourSchemeCopyDescriptor + struct VehicleColourSchemeCopyDescriptor { 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); - RCT1VehicleColourSchemeCopyDescriptor GetColourSchemeCopyDescriptor(uint8_t vehicleType); - bool RideTypeUsesVehicles(uint8_t rideType); + uint8_t GetRideType(RideType rideType, uint8_t vehicleType); + VehicleColourSchemeCopyDescriptor GetColourSchemeCopyDescriptor(uint8_t vehicleType); + 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); diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 3612b761e1..65d85ebc93 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" @@ -435,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 @@ -1045,7 +1044,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) @@ -1053,7 +1052,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) @@ -1281,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; } } } @@ -1349,3 +1346,81 @@ RCT12TrackType OpenRCT2FlatTrackTypeToRCT12(track_type_t origTrackType) return 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", +}; + +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::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); + if (it != std::end(_musicStyles)) + { + return std::distance(std::begin(_musicStyles), it); + } + 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 7d25590af7..3e23bc95c7 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -17,6 +17,9 @@ #include #include +#include + +class ObjectList; using track_type_t = uint16_t; using RCT12TrackType = uint8_t; @@ -26,6 +29,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; @@ -85,6 +90,11 @@ 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(); + +constexpr const uint8_t RCT12GuestsInParkHistoryFactor = 20; +constexpr const uint8_t RCT12ParkHistoryUndefined = std::numeric_limits::max(); + enum class RCT12TrackDesignVersion : uint8_t { TD4, @@ -191,12 +201,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; } @@ -932,3 +942,35 @@ 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; + +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(static_cast(i)); + } + } + return ridesBeenOn; +} diff --git a/src/openrct2/rct12/SawyerChunkReader.cpp b/src/openrct2/rct12/SawyerChunkReader.cpp index cf03dfdc5b..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. @@ -27,9 +28,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) { } @@ -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); @@ -79,10 +79,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 +126,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&) @@ -304,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; @@ -324,20 +316,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 0873c8b845..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 @@ -57,12 +56,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 @@ -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); }; 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..b944c3d1b1 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(); @@ -89,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..80048c8a10 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" @@ -21,28 +23,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; @@ -143,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; @@ -161,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 10003fb038..f091c5d557 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,9 +38,10 @@ 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_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 +60,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 +76,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, @@ -538,8 +540,7 @@ struct RCT2SpriteVehicle : RCT12SpriteBase }; uint8_t animation_frame; // 0xC5 uint8_t pad_C6[0x2]; - uint16_t var_C8; - uint16_t var_CA; + uint32_t animationState; uint8_t scream_sound_id; // 0xCC uint8_t TrackSubposition; union @@ -746,6 +747,13 @@ struct RCT2SpritePeep : RCT12SpriteBase }; assert_struct_size(RCT2SpritePeep, 0x100); +enum class RCT2StaffMode : uint8_t +{ + None, + Walk, + Patrol = 3 +}; + union RCT2Sprite { private: @@ -787,6 +795,280 @@ 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] + 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; + 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]; + RCT2StaffMode 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); + +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); @@ -794,7 +1076,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); RCT12TrackType OpenRCT2TrackTypeToRCT2(track_type_t origTrackType); /** @@ -802,3 +1084,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/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index a612e6af35..60dd8c5c94 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" @@ -17,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" @@ -31,7 +33,8 @@ #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" #include "../ride/Ride.h" @@ -62,6 +65,8 @@ #include #include +#define ENCRYPT_MONEY(money) (static_cast(Numerics::ror32((money), 13) ^ 0xF4EC9621)) + S6Exporter::S6Exporter() { RemoveTracklessRides = false; @@ -118,7 +123,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); @@ -157,38 +162,161 @@ void S6Exporter::Save(OpenRCT2::IStream* stream, bool isScenario) stream->WriteValue(checksum); } -void S6Exporter::Export() +static void ride_all_has_any_track_elements(std::array& rideIndexArray) { - _s6.info = gS6Info; + tile_element_iterator it; + tile_element_iterator_begin(&it); + while (tile_element_iterator_next(&it)) { - auto temp = utf8_to_rct2(gS6Info.name); - safe_strcpy(_s6.info.name, temp.data(), sizeof(_s6.info.name)); - } - { - auto temp = utf8_to_rct2(gS6Info.details); - safe_strcpy(_s6.info.details, temp.data(), sizeof(_s6.info.details)); - } - uint32_t researchedTrackPiecesA[128] = {}; - uint32_t researchedTrackPiecesB[128] = {}; + if (it.element->GetType() != TILE_ELEMENT_TYPE_TRACK) + continue; + if (it.element->IsGhost()) + continue; - for (int32_t i = 0; i < RCT2_OBJECT_ENTRY_COUNT; i++) + rideIndexArray[EnumValue(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++) { - 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)) + auto ride = &s6->rides[i]; + if (rideHasTrack[i] || ride->type == RIDE_TYPE_NULL) { - std::memset(&_s6.objects[i], 0xFF, sizeof(rct_object_entry)); + 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; + } + } +} + +template +static void ExportObjectList(IObjectManager& objMgr, T& objects) +{ + for (size_t i = 0; i < TMaxEntries; i++) + { + auto& dst = objects[i]; + + const auto* object = objMgr.GetLoadedObject(TObjectType, i); + if (object == nullptr) + { + // The sv6 format expects null/invalid entries to be filled with 0xFF. + std::memset(&dst, 0xFF, sizeof(dst)); } else { - _s6.objects[i] = *entry; + dst = object->GetObjectEntry(); } } +} + +void S6Exporter::Export() +{ + _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(gScenarioName.c_str()); + safe_strcpy(_s6.info.name, temp.data(), sizeof(_s6.info.name)); + } + { + 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] = {}; + + auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager(); + 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; - _s6.scenario_ticks = gScenarioTicks; + _s6.scenario_ticks = gCurrentTicks; auto state = scenario_rand_state(); _s6.scenario_srand_0 = state.s0; @@ -200,8 +328,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 +354,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 @@ -238,7 +372,16 @@ 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++) + { + 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; @@ -268,7 +411,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 +428,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,16 +468,16 @@ 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; - _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; @@ -379,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 @@ -456,11 +599,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; } @@ -468,9 +611,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 @@ -486,7 +629,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; @@ -528,9 +671,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; } @@ -547,9 +690,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 { @@ -559,9 +702,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 { @@ -574,14 +717,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) }; @@ -637,9 +780,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 { @@ -693,7 +836,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 +886,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++) { @@ -808,9 +951,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); @@ -835,8 +978,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[dst.ride_index].measurement_index = i; i++; } } @@ -946,6 +1089,65 @@ 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::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 @@ -954,6 +1156,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) @@ -975,28 +1180,21 @@ 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 SpriteBase* src) +constexpr RCT12EntityLinkListOffset GetRCT2LinkListOffset(const EntityBase* src) { RCT12EntityLinkListOffset output = RCT12EntityLinkListOffset::Free; switch (src->Type) @@ -1004,7 +1202,7 @@ constexpr RCT12EntityLinkListOffset GetRCT2LinkListOffset(const SpriteBase* src) case EntityType::Vehicle: { auto veh = src->As(); - if (veh && veh->IsHead()) + if (veh != nullptr && veh->IsHead()) { output = RCT12EntityLinkListOffset::TrainHead; } @@ -1038,7 +1236,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) @@ -1070,7 +1268,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); @@ -1078,15 +1276,15 @@ void S6Exporter::ExportEntityCommonProperties(RCT12SpriteBase* dst, const Sprite 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->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; } @@ -1101,15 +1299,15 @@ 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; 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 { @@ -1161,8 +1359,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->var_CA = src->var_CA; + dst->animationState = src->animationState; dst->scream_sound_id = static_cast(src->scream_sound_id); dst->TrackSubposition = static_cast(src->TrackSubposition); dst->var_CE = src->var_CE; @@ -1170,7 +1367,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; @@ -1195,9 +1392,22 @@ 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) + { + const auto rideIndex = EnumValue(rideId); + dst->rides_been_on[rideIndex / 8] |= (1 << (rideIndex % 8)); + } } dst->item_extra_flags = static_cast(src->GetItemFlags() >> 32); dst->photo1_ride_ref = OpenRCT2RideIdToRCT12RideId(src->Photo1RideRef); @@ -1206,10 +1416,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; @@ -1221,7 +1427,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; } @@ -1257,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; @@ -1274,9 +1479,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 @@ -1343,10 +1548,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; } @@ -1518,7 +1740,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, {}); + } } } @@ -1542,9 +1771,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) @@ -1572,9 +1801,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; } } @@ -1644,7 +1874,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()); @@ -1686,8 +1916,8 @@ 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()); - if (ride) + auto ride = get_ride(static_cast(dst2->GetRideIndex())); + if (ride != nullptr) { if (ride->type == RIDE_TYPE_MAZE) { @@ -1735,7 +1965,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/S6Exporter.h b/src/openrct2/rct2/S6Exporter.h index bc673854b7..12e28128ff 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; +struct EntityBase; +struct Peep; union rct_sprite; -struct SpriteBase; /** * Class to export RollerCoaster Tycoon 2 scenarios (*.SC6) and saved games (*.SV6). @@ -50,7 +51,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: @@ -78,4 +79,6 @@ private: std::optional AllocateUserString(std::string_view value); 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 d4120c213b..854596e39d 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" @@ -17,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" @@ -30,9 +32,11 @@ #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" +#include "../peep/Guest.h" +#include "../peep/RideUseSystem.h" #include "../peep/Staff.h" #include "../rct12/RCT12.h" #include "../rct12/SawyerChunkReader.h" @@ -67,6 +71,9 @@ #include "../world/Surface.h" #include +#include + +#define DECRYPT_MONEY(money) (static_cast(Numerics::rol32((money) ^ 0xF4EC9621, 13))) /** * Class to import RollerCoaster Tycoon 2 scenarios (*.SC6) and saved games (*.SV6). @@ -80,6 +87,7 @@ private: rct_s6_data _s6{}; uint8_t _gameVersion = 0; bool _isSV7 = false; + std::bitset _isFlatRide{}; public: S6Importer(IObjectRepository& objectRepository) @@ -94,14 +102,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 @@ -167,9 +173,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); @@ -183,7 +190,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); @@ -204,34 +210,38 @@ 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 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) { - 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 = loadMaybeUTF8(_s6.info.name); + gScenarioDetails = loadMaybeUTF8(_s6.info.details); } else { - safe_strcpy(gS6Info.name, _s6.info.name, sizeof(gS6Info.name)); - safe_strcpy(gS6Info.details, _s6.info.details, sizeof(gS6Info.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); gDateMonthTicks = _s6.current_day; - gScenarioTicks = _s6.scenario_ticks; + gCurrentTicks = _s6.game_ticks_1; scenario_rand_seed(_s6.scenario_srand_0, _s6.scenario_srand_1); + DetermineFlatRideStatus(); 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 +266,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]); } } @@ -270,8 +280,16 @@ public: gParkRating = _s6.park_rating; - 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)); + auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); + park.ResetHistories(); + 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) + { + gGuestsInParkHistory[i] = _s6.guests_in_park_history[i] * RCT12GuestsInParkHistoryFactor; + } + } gResearchPriorities = _s6.active_research_types; gResearchProgressStage = _s6.research_progress_stage; @@ -293,7 +311,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 +327,25 @@ public: gScenarioObjective.NumGuests = _s6.objective_guests; ImportMarketingCampaigns(); - gCurrentExpenditure = _s6.current_expenditure; - gCurrentProfit = _s6.current_profit; - gWeeklyProfitAverageDividend = _s6.weekly_profit_average_dividend; + 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]; - gWeeklyProfitHistory[i] = _s6.weekly_profit_history[i]; - gParkValueHistory[i] = _s6.park_value_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 = RCT12CompletedCompanyValueToOpenRCT2(_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,16 +366,13 @@ 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; - 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; @@ -367,8 +382,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. @@ -396,7 +409,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(); @@ -410,8 +422,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 @@ -469,9 +479,16 @@ 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(); + + research_determine_first_of_type(); + staff_update_greyed_patrol_areas(); + } + + 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 +503,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() @@ -497,12 +539,53 @@ 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); } } } + /** + * 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++) + { + auto src = &_s6.rides[index]; + if (src->type == RIDE_TYPE_NULL) + continue; + + 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; + } + + // 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) + { + 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 = {}; @@ -549,9 +632,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 { @@ -561,9 +644,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 { @@ -576,12 +659,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 }); @@ -598,7 +681,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); @@ -650,9 +733,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 { @@ -704,7 +787,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 +838,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++) { @@ -774,7 +857,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. @@ -814,7 +902,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; @@ -834,7 +923,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(); @@ -926,7 +1016,7 @@ public: invented = false; continue; } - else if (researchItem.IsUninventedEndMarker() || researchItem.IsRandomEndMarker()) + if (researchItem.IsUninventedEndMarker() || researchItem.IsRandomEndMarker()) { break; } @@ -1023,7 +1113,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)) { @@ -1129,7 +1219,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()); @@ -1156,7 +1246,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, _isFlatRide[src2->GetRideIndex()])); + dst2->SetRideType(rideType); dst2->SetSequenceIndex(src2->GetSequenceIndex()); dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); dst2->SetColourScheme(src2->GetColourScheme()); @@ -1219,7 +1310,7 @@ public: dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); dst2->SetStationIndex(src2->GetStationIndex()); dst2->SetSequenceIndex(src2->GetSequenceIndex()); - dst2->SetPathType(src2->GetPathType()); + dst2->SetLegacyPathEntryIndex(src2->GetPathType()); break; } @@ -1246,9 +1337,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 +1370,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 +1389,6 @@ public: auto dst2 = dst->AsBanner(); auto src2 = src->AsBanner(); - dst2->SetIndex(src2->GetIndex()); dst2->SetPosition(src2->GetPosition()); dst2->SetAllowedEdges(src2->GetAllowedEdges()); @@ -1292,8 +1396,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 { @@ -1332,6 +1444,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++) @@ -1344,7 +1493,11 @@ public: void ImportEntityPeep(Peep* dst, const RCT2SpritePeep* src) { - ImportEntityCommonProperties(static_cast(dst), 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)) { dst->SetName(GetUserString(src->name_string_idx)); @@ -1380,10 +1533,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; } @@ -1451,7 +1622,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; @@ -1461,10 +1632,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; } @@ -1480,26 +1648,57 @@ public: return justText.data(); } - std::vector GetRequiredObjects() + template + static void AddRequiredObjects(std::vector& required, const T& list) { - 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++) + 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 < TInternalLimit; i++) + { + required.push_back(nullEntry); + } + } + + ObjectList GetRequiredObjects() + { + std::vector result; + + 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); + + ObjectList objectList; + for (size_t i = 0; i < result.size(); i++) + { + ObjectType objectType; + ObjectEntryIndex entryIndex; + get_type_entry_index(i, &objectType, &entryIndex); + + auto desc = ObjectEntryDescriptor(result[i]); + if (desc.HasValue()) { - 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); + assert(desc.GetType() == objectType); + objectList.SetObject(entryIndex, desc); } } - return result; + return objectList; } }; @@ -1516,20 +1715,20 @@ 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; 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 // 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())); } @@ -1594,8 +1793,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->var_CA = src->var_CA; + dst->animationState = src->animationState; dst->scream_sound_id = static_cast(src->scream_sound_id); dst->TrackSubposition = VehicleTrackSubposition{ src->TrackSubposition }; dst->var_CE = src->var_CE; @@ -1603,7 +1801,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; @@ -1612,6 +1810,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); @@ -1631,10 +1838,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); @@ -1642,13 +1849,9 @@ 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; + 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; @@ -1657,7 +1860,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 == RCT12PeepThoughtItemNone) + dstThought->item = PeepThoughtItemNone; + else + dstThought->item = srcThought->item; dstThought->freshness = srcThought->freshness; dstThought->fresh_timeout = srcThought->fresh_timeout; } @@ -1695,14 +1901,16 @@ 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; 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) @@ -1813,7 +2021,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) @@ -1887,7 +2095,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(); @@ -1927,7 +2135,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/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/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 d45d97aa73..75b912957f 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 @@ -128,7 +126,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; @@ -170,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; @@ -202,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; @@ -224,7 +222,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/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 913f395a80..8532e08256 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -54,8 +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->var_CA = 0; + current->animationState = 0; current->scream_sound_id = OpenRCT2::Audio::SoundId::Null; current->Pitch = 0; current->bank_rotation = 0; @@ -78,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; } @@ -392,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) @@ -405,31 +402,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/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/Ride.cpp b/src/openrct2/ride/Ride.cpp index f2f9e31f12..3e36f15532 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -15,17 +15,16 @@ #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" #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" @@ -75,6 +74,7 @@ #include using namespace OpenRCT2; +using namespace OpenRCT2::TrackMetaData; RideMode& operator++(RideMode& d, int) { @@ -87,49 +87,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); @@ -191,21 +148,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); @@ -295,7 +254,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; } @@ -304,7 +263,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); } @@ -382,7 +341,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(); @@ -390,8 +349,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) @@ -415,7 +374,7 @@ money32 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 @@ -454,10 +413,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& ted = 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)); + && (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)); // Set result tile to this track piece if first found track or a ??? if (resultTileElement == nullptr || specialTrackPiece) @@ -523,11 +483,12 @@ bool track_block_get_next_from_zero( if (tileElement->IsGhost() != isGhost) continue; - auto nextTrackBlock = TrackBlocks[trackElement->GetTrackType()]; + const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); + const auto* nextTrackBlock = ted.Block; if (nextTrackBlock == nullptr) continue; - auto nextTrackCoordinate = TrackCoordinates[trackElement->GetTrackType()]; + const auto& nextTrackCoordinate = ted.Coordinates; uint8_t nextRotation = tileElement->GetDirectionWithOffset(nextTrackCoordinate.rotation_begin) | (nextTrackCoordinate.rotation_begin & TRACK_BLOCK_2); @@ -572,13 +533,14 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 if (ride == nullptr) return false; - auto trackBlock = TrackBlocks[inputElement->GetTrackType()]; + const auto& ted = GetTrackElementDescriptor(inputElement->GetTrackType()); + const auto* trackBlock = ted.Block; if (trackBlock == nullptr) return false; trackBlock += inputElement->GetSequenceIndex(); - auto trackCoordinate = TrackCoordinates[inputElement->GetTrackType()]; + const auto& trackCoordinate = ted.Coordinates; int32_t x = input->x; int32_t y = input->y; @@ -640,11 +602,11 @@ bool track_block_get_previous_from_zero( if (trackElement->GetRideIndex() != ride->id) continue; - auto nextTrackBlock = TrackBlocks[trackElement->GetTrackType()]; + const auto* ted = &GetTrackElementDescriptor(trackElement->GetTrackType()); + const auto* nextTrackBlock = ted->Block; if (nextTrackBlock == nullptr) continue; - - auto nextTrackCoordinate = TrackCoordinates[trackElement->GetTrackType()]; + const auto& nextTrackCoordinate = ted->Coordinates; nextTrackBlock += trackElement->GetSequenceIndex(); if ((nextTrackBlock + 1)->index != 255) @@ -676,7 +638,8 @@ bool track_block_get_previous_from_zero( outTrackBeginEnd->begin_z = tileElement->GetBaseZ(); - auto nextTrackBlock2 = TrackBlocks[trackElement->GetTrackType()]; + ted = &GetTrackElementDescriptor(trackElement->GetTrackType()); + const auto* nextTrackBlock2 = ted->Block; if (nextTrackBlock2 == nullptr) continue; @@ -708,6 +671,7 @@ bool track_block_get_previous(const CoordsXYE& trackPos, track_begin_end* outTra return false; auto trackElement = trackPos.element->AsTrack(); + const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); if (trackElement == nullptr) return false; @@ -716,13 +680,13 @@ bool track_block_get_previous(const CoordsXYE& trackPos, track_begin_end* outTra if (ride == nullptr) return false; - auto trackBlock = TrackBlocks[trackElement->GetTrackType()]; + const auto* trackBlock = ted.Block; if (trackBlock == nullptr) return false; trackBlock += trackElement->GetSequenceIndex(); - auto trackCoordinate = TrackCoordinates[trackElement->GetTrackType()]; + auto trackCoordinate = ted.Coordinates; int32_t z = trackElement->GetBaseZ(); @@ -760,7 +724,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(); } @@ -944,1025 +908,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 @@ -1976,7 +921,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: @@ -2224,7 +1169,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; @@ -2252,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 }; /** @@ -2561,7 +1506,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, EnumValue(ride->id), ft); } } @@ -2588,7 +1533,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, EnumValue(ride->id), ft); } } } @@ -2705,10 +1650,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; } @@ -2808,32 +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) { - const auto& rtd = ride->GetRideTypeDescriptor(); - if (!rtd.HasFlag(RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT) && !rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) + int32_t sampleRate = 22050; + + // Alter sample rate for a power cut effect + if (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) { - return; + sampleRate = ride->breakdown_sound_modifier * 70; + if (ride->breakdown_reason_pending != BREAKDOWN_CONTROL_FAILURE) + sampleRate *= -1; + sampleRate += 22050; } - if (ride->status != RideStatus::Open || !(ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC)) - { - ride->music_tune_id = 255; - return; - } - - 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; - } - } + 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)) { @@ -2856,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) @@ -2877,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); } @@ -2940,7 +1931,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; @@ -2953,7 +1944,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; @@ -2962,7 +1953,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); @@ -3065,18 +2056,16 @@ 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, {} } }; } - 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 @@ -3213,7 +2202,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 }; @@ -3230,28 +2219,28 @@ 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; 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, EnumValue(ride->id), ft); } 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; 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, EnumValue(ride->id), ft); } ride->connected_message_throttle = 3; } @@ -3261,11 +2250,11 @@ 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; - TileElement* tileElement = map_get_first_element_at(shopLoc.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(shopLoc); do { if (tileElement == nullptr) @@ -3287,9 +2276,10 @@ static void ride_shop_connected(Ride* ride) return; } - uint8_t entrance_directions = TrackSequenceProperties[track_type][0] & 0xF; + 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) @@ -3319,7 +2309,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, EnumValue(ride->id), ft); } ride->connected_message_throttle = 3; @@ -3369,7 +2359,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(); @@ -3394,14 +2384,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(); @@ -3435,7 +2425,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(); @@ -3478,22 +2468,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 @@ -3503,7 +2477,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++; } @@ -3583,22 +2557,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; @@ -3629,14 +2603,14 @@ 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(); // 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 @@ -3661,7 +2635,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; @@ -3725,7 +2699,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(); } @@ -3738,7 +2712,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& ted = GetTrackElementDescriptor(trackType); + if (ted.Flags & TRACK_ELEM_FLAG_INVERSION_TO_NORMAL) { *output = it.current; return true; @@ -3783,7 +2758,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(); } @@ -3796,7 +2771,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& ted = GetTrackElementDescriptor(trackType); + if (ted.Flags & TRACK_ELEM_FLAG_BANKED) { *output = it.current; return true; @@ -3823,7 +2799,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(); @@ -3845,7 +2821,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& ted = GetTrackElementDescriptor(output->element->AsTrack()->GetTrackType()); + if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { num_station_elements++; last_good_station = *output; @@ -3884,7 +2861,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(); } @@ -3892,7 +2869,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)) + const auto* ted = &GetTrackElementDescriptor(trackType); + if (!(ted->SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return false; } @@ -3901,7 +2879,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)) + ted = &GetTrackElementDescriptor(trackType); + if (!(ted->SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return false; } @@ -3931,13 +2910,15 @@ 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); - returnPos = newCoords == std::nullopt ? CoordsXYE{ trackCoords, returnPos.element } - : CoordsXYE{ *newCoords, returnPos.element }; + auto newCoords = GetTrackElementOriginAndApplyChanges( + { trackCoords, static_cast(direction) }, trackType, 0, &returnPos.element, 0); + returnPos = newCoords.has_value() ? CoordsXYE{ newCoords.value(), returnPos.element } + : CoordsXYE{ trackCoords, returnPos.element }; }; trackType = returnPos.element->AsTrack()->GetTrackType(); - int32_t elementReturnDirection = TrackCoordinates[trackType].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 }; } @@ -3958,23 +2939,23 @@ 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(); - TileElement* tileElement = map_get_first_element_at(position->ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(*position); do { if (tileElement == nullptr) @@ -4107,7 +3088,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; @@ -4138,7 +3119,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; @@ -4167,9 +3148,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); @@ -4198,7 +3185,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) @@ -4271,7 +3258,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; } @@ -4313,15 +3300,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++) { @@ -4330,6 +3318,12 @@ 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) + { + allTrainsCreated = false; + continue; + } + if (vehicleIndex == 0) { firstTrain = train; @@ -4357,6 +3351,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; } /** @@ -4463,10 +3459,16 @@ bool Ride::CreateVehicles(const CoordsXYE& element, bool isApplying) trackElement = map_get_track_element_at(vehiclePos); vehiclePos.z = trackElement->GetBaseZ(); - 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 @@ -4533,8 +3535,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)) { @@ -4569,7 +3579,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)) { @@ -4589,7 +3599,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& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (!(ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { continue; } @@ -4654,7 +3665,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; @@ -4707,9 +3718,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; @@ -4744,7 +3755,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; @@ -4752,16 +3763,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; @@ -4797,7 +3808,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() }); @@ -4821,8 +3832,8 @@ TrackElement* Ride::GetOriginElement(StationIndex stationIndex) const continue; auto* trackElement = tileElement->AsTrack(); - - if (!(TrackSequenceProperties[trackElement->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); + if (!(ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; if (trackElement->GetRideIndex() == id) @@ -4838,13 +3849,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", EnumValue(id)); return false; } if (newStatus != RideStatus::Simulating) { - window_close_by_number(WC_RIDE_CONSTRUCTION, id); + window_close_by_number(WC_RIDE_CONSTRUCTION, EnumValue(id)); } StationIndex stationIndex = ride_mode_check_station_present(this); @@ -4971,9 +3982,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 + 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, id); + { + window_close_by_number(WC_RIDE_CONSTRUCTION, EnumValue(id)); + } StationIndex stationIndex = ride_mode_check_station_present(this); if (stationIndex == STATION_INDEX_NULL) @@ -5137,64 +4150,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 @@ -5351,10 +4306,8 @@ RideNaming get_ride_naming(const uint8_t rideType, rct_ride_entry* rideEntry) { return GetRideTypeDescriptor(rideType).Naming; } - else - { - return rideEntry->naming; - } + + return rideEntry->naming; } /* @@ -5717,315 +4670,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 @@ -6047,7 +4691,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)); } /** @@ -6146,22 +4790,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 @@ -6258,9 +4900,9 @@ 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) + if (!result.has_value() || station.Length < result.value()) { result = station.Length; } @@ -6283,7 +4925,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); @@ -6295,7 +4937,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& ted = GetTrackElementDescriptor(trackType); + if (!(ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; if (tileElement->GetBaseZ() != trackStart.z) @@ -6311,7 +4954,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(); } @@ -6326,7 +4969,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& ted = GetTrackElementDescriptor(trackType); + result += ted.PieceLength; moveSlowIt = !moveSlowIt; if (moveSlowIt) @@ -6371,7 +5015,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--) @@ -6493,7 +5137,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, EnumValue(id)); } } @@ -6524,230 +5168,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; @@ -6786,7 +5206,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, EnumValue(id), ft); } } @@ -6966,7 +5386,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 }); @@ -7028,16 +5448,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() @@ -7141,7 +5559,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); @@ -7156,7 +5574,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); @@ -7180,11 +5598,11 @@ 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 }.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); if (tileElement != nullptr) { @@ -7366,3 +5784,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 521192e014..3375497642 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" @@ -309,7 +308,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,11 +358,11 @@ 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; + ObjectEntryIndex music; + ObjectEntryIndex entrance_style; uint16_t vehicle_change_timeout; uint8_t num_block_brakes; uint8_t lift_hill_speed; @@ -393,7 +392,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; @@ -425,6 +424,7 @@ public: bool SupportsStatus(RideStatus s) const; void StopGuestsQueuing(); + void ValidateStations(); bool Open(bool isApplying); bool Test(RideStatus newStatus, bool isApplying); @@ -451,7 +451,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; @@ -466,6 +466,13 @@ public: uint8_t GetNumShelteredSections() const; 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) @@ -879,17 +886,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, + MazeBuild, + MazeMove, + MazeFill }; enum @@ -1084,7 +1091,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; @@ -1112,12 +1119,12 @@ 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; -extern uint8_t gLastEntranceStyle; +extern ObjectEntryIndex gLastEntranceStyle; int32_t ride_get_count(); void ride_init_all(); @@ -1146,11 +1153,11 @@ 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); -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); @@ -1217,9 +1224,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(); @@ -1252,5 +1257,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/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/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp new file mode 100644 index 0000000000..54fa013b39 --- /dev/null +++ b/src/openrct2/ride/RideConstruction.cpp @@ -0,0 +1,1659 @@ +/***************************************************************************** + * 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 "../peep/Staff.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 "TrainManager.h" +#include "Vehicle.h" + +using namespace OpenRCT2::TrackMetaData; +bool gGotoStartPlacementMode = false; + +money16 gTotalRideValueForMoney; + +money32 _currentTrackPrice; + +uint16_t _numCurrentPossibleRideConfigurations; +uint16_t _numCurrentPossibleSpecialTrackPieces; + +uint32_t _currentTrackCurve; +RideConstructionState _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; + +ObjectEntryIndex gLastEntranceStyle; + +uint8_t gRideEntranceExitPlaceType; +ride_id_t gRideEntranceExitPlaceRideIndex; +StationIndex gRideEntranceExitPlaceStationIndex; +RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState; +Direction gRideEntranceExitPlaceDirection; + +using namespace OpenRCT2; +using namespace OpenRCT2::TrackMetaData; + +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, EnumValue(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 + */ +void Ride::RemoveVehicles() +{ + if (lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + { + 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 = 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); + } + + vehicles[i] = SPRITE_INDEX_NULL; + } + + for (size_t i = 0; i < MAX_STATIONS; i++) + 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); + } + } + } +} + +/** + * + * 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->RemoveVehicles(); + ride_clear_blocked_tiles(ride); + + auto w = window_find_by_number(WC_RIDE, EnumValue(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 }); + 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 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) + 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 + const auto& ted = GetTrackElementDescriptor(type); + const auto* trackBlock = ted.Block; + 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 RideConstructionState::Selected: + GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, + nullptr, TRACK_ELEMENT_SET_HIGHLIGHT_FALSE); + break; + case RideConstructionState::MazeBuild: + 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 RideConstructionState::Place: + case RideConstructionState::EntranceExit: + 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 = RideConstructionState::State0; + } +} + +/** + * + * 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; + + const TrackElementDescriptor* ted; + switch (_rideConstructionState) + { + case RideConstructionState::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; + } + } + + ted = &GetTrackElementDescriptor(trackType); + curve = ted->CurveChain.next; + bank = ted->Definition.bank_end; + slope = ted->Definition.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 RideConstructionState::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; + } + } + + ted = &GetTrackElementDescriptor(trackType); + curve = ted->CurveChain.previous; + bank = ted->Definition.bank_start; + slope = ted->Definition.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; + default: + break; + } +} + +/** + * + * rct2: 0x006C9296 + */ +void ride_select_next_section() +{ + if (_rideConstructionState == RideConstructionState::Selected) + { + ride_construction_invalidate_current_track(); + int32_t direction = _currentTrackPieceDirection; + int32_t type = _currentTrackPieceType; + TileElement* tileElement; + auto newCoords = GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); + if (!newCoords.has_value()) + { + _rideConstructionState = RideConstructionState::State0; + 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 = RideConstructionState::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 == RideConstructionState::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 == RideConstructionState::Selected) + { + ride_construction_invalidate_current_track(); + int32_t direction = _currentTrackPieceDirection; + int32_t type = _currentTrackPieceType; + TileElement* tileElement; + auto newCoords = GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); + if (newCoords == std::nullopt) + { + _rideConstructionState = RideConstructionState::State0; + 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 = RideConstructionState::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 == RideConstructionState::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 != RideConstructionState::EntranceExit || !(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 != RideConstructionState::EntranceExit) + { + gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; + _rideConstructionState = RideConstructionState::EntranceExit; + } + + 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 = RideConstructionState::MazeBuild; + _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 = GetTrackElementOriginAndApplyChanges({ tileCoords, direction }, type, 0, nullptr, 0); + if (!newCoords.has_value()) + return false; + + _currentRideIndex = rideIndex; + _rideConstructionState = RideConstructionState::Selected; + _currentTrackBegin = newCoords.value(); + _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 == RideConstructionState::Front) + { + window_ride_construction_update_active_elements(); + return true; + } + + _rideConstructionState = RideConstructionState::Selected; + _currentTrackBegin = *newCoords; + _currentTrackPieceDirection = direction; + _currentTrackPieceType = type; + _currentTrackSelectionFlags = 0; + + ride_select_previous_section(); + + if (_rideConstructionState != RideConstructionState::Back) + { + _rideConstructionState = RideConstructionState::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 = RideConstructionState::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; +} + +/** + * + * rct2: 0x006CCF70 + */ +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) + { + if (info.Element->GetType() == TILE_ELEMENT_TYPE_TRACK) + { + const auto* trackElement = info.Element->AsTrack(); + if (trackElement->GetRideIndex() == gRideEntranceExitPlaceRideIndex) + { + const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); + if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) + { + if (trackElement->GetTrackType() == TrackElemType::Maze) + { + gRideEntranceExitPlaceStationIndex = 0; + } + else + { + gRideEntranceExitPlaceStationIndex = trackElement->GetStationIndex(); + } + } + } + } + } + + auto ride = get_ride(gRideEntranceExitPlaceRideIndex); + if (ride == nullptr) + { + entranceExitCoords.SetNull(); + return entranceExitCoords; + } + + auto stationBaseZ = ride->stations[gRideEntranceExitPlaceStationIndex].GetBaseZ(); + + auto coordsAtHeight = screen_get_map_xy_with_z(screenCoords, stationBaseZ); + if (!coordsAtHeight.has_value()) + { + entranceExitCoords.SetNull(); + return entranceExitCoords; + } + + entranceExitCoords = { coordsAtHeight->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; + } + + // 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; + auto* trackElement = tileElement->AsTrack(); + if (trackElement->GetRideIndex() != gRideEntranceExitPlaceRideIndex) + continue; + if (trackElement->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 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 + + gRideEntranceExitPlaceStationIndex = trackElement->GetStationIndex(); + + // 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; +} + +/** + * + * rct2: 0x006CB945 + */ +void Ride::ValidateStations() +{ + const TrackElementDescriptor* ted; + 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 (stations[stationId].Start.IsNull()) + continue; + + 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; + location.y -= CoordsDirectionDelta[direction].y; + } + tileElement = map_get_first_element_at(location); + if (tileElement == nullptr) + break; + + // find the target TrackElement on the tile it's supposed to appear on + bool trackFound = false; + do + { + if (tileElement->GetBaseZ() != location.z) + continue; + if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + continue; + 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; + + trackFound = true; + break; + } while (!(tileElement++)->IsLastForTile()); + + if (!trackFound) + { + break; + } + // update the StationIndex, get the TrackElement's rotation + tileElement->AsTrack()->SetStationIndex(stationId); + direction = tileElement->GetDirection(); + + // 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)) + { + // 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) + { + 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; + // find the target TrackElement on the tile it's supposed to appear on + do + { + if (blockLocation.z != tileElement->GetBaseZ()) + continue; + if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + continue; + + ted = &GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (!(ted->SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + continue; + + trackFound = true; + break; + } while (!(tileElement++)->IsLastForTile()); + + if (!trackFound) + { + // Critical error! Stop trying to find the next sequence to set StationIndex. + break; + } + + tileElement->AsTrack()->SetStationIndex(stationId); + } + } + } + // determine what entrances and exits exist + FixedVector locations; + for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) + { + auto entrance = ride_get_entrance_location(this, stationId); + if (!entrance.IsNull()) + { + locations.push_back(entrance); + ride_clear_entrance_location(this, stationId); + } + + auto exit = ride_get_exit_location(this, stationId); + if (!exit.IsNull()) + { + locations.push_back(exit); + ride_clear_exit_location(this, stationId); + } + } + + auto locationListIter = locations.cbegin(); + for (const TileCoordsXYZD& locationCoords : locations) + { + auto locationList = ++locationListIter; + // 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()) + { + const TileCoordsXYZD& locationCoords2 = *locationList++; + if (locationCoords.x == locationCoords2.x && locationCoords.y == locationCoords2.y + && locationCoords.z == locationCoords2.z) + { + duplicateLocation = true; + break; + } + } + + if (duplicateLocation) + { + // if it's a duplicate continue to the next ride entrance + continue; + } + // if it's not a duplicate location + 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() != 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 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 ride entrance (see below) + 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() != id) + continue; + if (trackElement->base_height != tileElement->base_height) + continue; + + auto trackType = trackElement->AsTrack()->GetTrackType(); + + // 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) + { + // 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 location to this one + CoordsXYZD loc = { location, stations[stationId].GetBaseZ(), tileElement->GetDirection() }; + ride_set_exit_location(this, stationId, TileCoordsXYZD{ loc }); + } + else + { + // 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 location to this one + CoordsXYZD loc = { location, stations[stationId].GetBaseZ(), tileElement->GetDirection() }; + ride_set_entrance_location(this, stationId, TileCoordsXYZD{ loc }); + } + // set the entrance's StationIndex as this station + tileElement->AsEntrance()->SetStationIndex(stationId); + shouldRemove = false; + } while (!(trackElement++)->IsLastForTile()); + + // remove the ride entrance and clean up if necessary + 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 = RideConstructionState::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 = RideConstructionState::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; +} 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/RideData.h b/src/openrct2/ride/RideData.h index a55effda55..76e92a533e 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(...) \ { \ @@ -168,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 */ @@ -296,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)]; @@ -344,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), @@ -365,5 +378,3 @@ constexpr bool RideTypeIsValid(ObjectEntryIndex rideType) { return rideType < std::size(RideTypeDescriptors); } - -#endif diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 58265bbbb9..d2bcc2ccc0 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(EnumValue(currentRide) + 1); + if (currentRide >= static_cast(MAX_RIDES)) { - currentRide = 0; + currentRide = {}; } auto ride = get_ride(currentRide); @@ -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; } @@ -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, EnumValue(state.CurrentRide)); state.State = RIDE_RATINGS_STATE_FIND_NEXT_RIDE; } @@ -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; } @@ -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()) { @@ -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", EnumValue(ride->id)); obj.Set("excitement", originalExcitement); obj.Set("intensity", originalIntensity); obj.Set("nausea", originalNausea); @@ -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 @@ -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/RideTypes.h b/src/openrct2/ride/RideTypes.h index 2a1567ad4b..b9747b58c8 100644 --- a/src/openrct2/ride/RideTypes.h +++ b/src/openrct2/ride/RideTypes.h @@ -13,11 +13,14 @@ #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()); + +using ride_type_t = uint16_t; /** * Couples a ride type and subtype together. 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 f62414cb19..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" @@ -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) @@ -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(); @@ -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 73fa7f8946..33406d53bb 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; @@ -369,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; } @@ -604,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; @@ -701,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) @@ -738,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) @@ -873,7 +596,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; @@ -1006,6 +730,16 @@ void TrackElement::SetTrackType(uint16_t newType) TrackType = newType; } +ride_type_t TrackElement::GetRideType() const +{ + return RideType; +} + +void TrackElement::SetRideType(const ride_type_t rideType) +{ + RideType = rideType; +} + uint8_t TrackElement::GetSequenceIndex() const { return Sequence; diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index ac21d47da3..4c65c732f9 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), // 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 @@ -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 57e88855ca..100dc1a637 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -12,10 +12,11 @@ #include "Track.h" #include "TrackPaint.h" +#include #include // clang-format off -const 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 @@ -286,7 +287,7 @@ const rct_track_coordinates TrackCoordinates[TrackElemType::Count] = { }; /** rct2: 0x0099BA64 */ -const 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 }, @@ -558,7 +559,7 @@ const 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 }; @@ -2544,7 +2545,7 @@ static constexpr const rct_preview_track TrackBlocksFlatTrack3x3[] = { }; // rct2: 0x00994638 -const rct_preview_track *TrackBlocks[TrackElemType::Count] = { +static constexpr std::array TrackBlocks = { TrackBlocks000, TrackBlocks001, TrackBlocks002, @@ -2815,7 +2816,7 @@ const rct_preview_track *TrackBlocks[TrackElemType::Count] = { TrackBlocksFlatTrack3x3, }; -const uint8_t TrackPieceLengths[TrackElemType::Count] = { +static constexpr uint8_t TrackPieceLengths[TrackElemType::Count] = { 32, // TrackElemType::Flat 32, // TrackElemType::EndStation 32, // TrackElemType::BeginStation @@ -3086,7 +3087,7 @@ const uint8_t TrackPieceLengths[TrackElemType::Count] = { }; // rct2: 0x00998C95 -const 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 }, @@ -3502,7 +3503,7 @@ const track_descriptor gTrackDescriptors[142] = { }; /** rct2: 0x00993D1C */ -const track_type_t AlternativeTrackTypes[TrackElemType::Count] = { +static constexpr track_type_t AlternativeTrackTypes[TrackElemType::Count] = { TrackElemType::FlatCovered, // TrackElemType::Flat TrackElemType::None, TrackElemType::None, @@ -3773,7 +3774,7 @@ const track_type_t AlternativeTrackTypes[TrackElemType::Count] = { }; /** rct2: 0x0099DA34 */ -const money32 TrackPricing[TrackElemType::Count] = { +static constexpr money32 TrackPricing[TrackElemType::Count] = { 65536, // TrackElemType::Flat 98304, // TrackElemType::EndStation 98304, // TrackElemType::BeginStation @@ -4044,7 +4045,7 @@ const money32 TrackPricing[TrackElemType::Count] = { }; /** rct2: 0x0099EA1C */ -const track_type_t TrackElementMirrorMap[TrackElemType::Count] = { +static constexpr track_type_t TrackElementMirrorMap[TrackElemType::Count] = { TrackElemType::Flat, TrackElemType::EndStation, TrackElemType::BeginStation, @@ -4315,7 +4316,7 @@ const track_type_t TrackElementMirrorMap[TrackElemType::Count] = { }; /** rct2: 0x00999694 */ -const uint32_t TrackHeightMarkerPositions[TrackElemType::Count] = { +static constexpr uint32_t TrackHeightMarkerPositions[TrackElemType::Count] = { (1 << 0), // TrackElemType::Flat (1 << 0), // TrackElemType::EndStation (1 << 0), // TrackElemType::BeginStation @@ -4586,7 +4587,7 @@ const uint32_t TrackHeightMarkerPositions[TrackElemType::Count] = { }; /** rct2: 0x00999A94 */ -const 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 @@ -4857,7 +4858,7 @@ const uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][MaxSequ }; /** rct2: 0x0099423C */ -const 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, @@ -5127,3 +5128,341 @@ const uint16_t TrackFlags[TrackElemType::Count] = { /* TrackElemType::FlatTrack3x3 */ 0, }; // 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 + +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 + { + 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.MirrorElement = TrackElementMirrorMap[i]; + desc.PieceLength = TrackPieceLengths[i]; + desc.Price = TrackPricing[i]; + desc.Definition = TrackDefinitions[i]; + desc.SpinFunction = TrackTypeToSpinFunction[i]; + + for (uint8_t j = 0; j < MaxSequencesPerPiece; j++) + { + desc.SequenceElementAllowedWallEdges[j] = TrackSequenceElementAllowedWallEdges[i][j]; + desc.SequenceProperties[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..1d8b3c4199 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -16,13 +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]; - -extern const rct_preview_track* TrackBlocks[TrackElemType::Count]; - -extern const uint8_t TrackPieceLengths[TrackElemType::Count]; struct track_curve_chain { @@ -30,8 +23,6 @@ struct track_curve_chain int32_t previous; }; -extern const track_curve_chain gTrackCurveChain[TrackElemType::Count]; - struct track_descriptor { bool starts_diagonal; @@ -43,12 +34,25 @@ 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]; -extern const track_type_t AlternativeTrackTypes[TrackElemType::Count]; - -extern const money32 TrackPricing[TrackElemType::Count]; - struct dodgems_track_size { uint8_t left; @@ -67,10 +71,32 @@ 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 uint32_t TrackHeightMarkerPositions[TrackElemType::Count]; +struct TrackElementDescriptor +{ + rct_track_coordinates Coordinates; -extern const uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][16]; + rct_preview_track* Block; + uint8_t PieceLength; + track_curve_chain CurveChain; + track_type_t AlternativeType; + money32 Price; + track_type_t MirrorElement; + uint32_t HeightMarkerPositions; + uint16_t Flags; -extern const uint16_t TrackFlags[TrackElemType::Count]; + std::array SequenceElementAllowedWallEdges; + std::array SequenceProperties; + + rct_trackdefinition Definition; + uint8_t SpinFunction; +}; + +namespace OpenRCT2 +{ + namespace TrackMetaData + { + void Init(); + 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 496b2c1e45..4e7bef98d2 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -33,12 +33,15 @@ #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" #include "../localisation/StringIds.h" #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" @@ -56,6 +59,7 @@ #include "RideData.h" #include "Track.h" #include "TrackData.h" +#include "TrackDesign.h" #include "TrackDesignRepository.h" #include "Vehicle.h" @@ -65,27 +69,15 @@ using namespace OpenRCT2; using namespace OpenRCT2::Drawing; +using namespace OpenRCT2::TrackMetaData; -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; static CoordsXYZ _trackPreviewOrigin; -bool byte_9D8150; +bool _trackDesignDrawingPreview; static uint8_t _trackDesignPlaceOperation; -static money32 _trackDesignPlaceCost; static int16_t _trackDesignPlaceZ; static int16_t _trackDesignPlaceSceneryZ; @@ -101,11 +93,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; @@ -165,10 +164,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) @@ -185,9 +182,10 @@ 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) + if (!newCoords.has_value()) { return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY; } @@ -195,8 +193,9 @@ 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()]; - auto trackBlock = TrackBlocks[trackType]; + 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. @@ -240,15 +239,15 @@ 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) + if (!newCoords.has_value()) { break; } trackElement.x = newCoords->x; trackElement.y = newCoords->y; - z = newCoords->z; if (track_elements.size() > TD6MaxTrackElements) { @@ -273,7 +272,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) location = ride_get_exit_location(&ride, station_index); } - if (location.isNull()) + if (location.IsNull()) { continue; } @@ -327,7 +326,7 @@ 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(PreviewRideId), { 4096, 4096, 0 }); // Resave global vars for scenery reasons. _trackPreviewOrigin = startPos; @@ -359,7 +358,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) @@ -387,7 +386,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; } @@ -416,7 +415,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; } @@ -446,7 +445,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(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; @@ -465,7 +464,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) @@ -601,7 +600,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); @@ -638,46 +637,171 @@ 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) { - const rct_object_entry* sceneryEntry = &scenery.scenery_object; - object_manager_load_object(sceneryEntry); + if (scenery.scenery_object.HasValue()) + { + objectManager.LoadObject(scenery.scenery_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 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; + + 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(); + + // 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; + 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++) { @@ -722,13 +846,13 @@ 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 (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); } @@ -752,6 +876,7 @@ static void track_design_mirror_scenery(TrackDesign* td6) break; } case ObjectType::Paths: + case ObjectType::FootpathSurface: { scenery.y = -scenery.y; @@ -767,7 +892,6 @@ static void track_design_mirror_scenery(TrackDesign* td6) break; } default: - // This switch processes only ObjectType for Scenery items. break; } } @@ -781,7 +905,8 @@ static void track_design_mirror_ride(TrackDesign* td6) { for (auto& track : td6->track_elements) { - track.type = TrackElementMirrorMap[track.type]; + const auto& ted = GetTrackElementDescriptor(track.type); + track.type = ted.MirrorElement; } for (auto& entrance : td6->entrance_elements) @@ -863,54 +988,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 (PathSurfaceEntry* path = get_path_surface_entry(0); - entry_index < object_entry_group_counts[EnumValue(ObjectType::Paths)]; - path = get_path_surface_entry(entry_index), entry_index++) - { - if (path == nullptr) - { - return true; - } - if (path->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) - { - 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; } @@ -925,24 +1007,22 @@ 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); - 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, + 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)) { 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 +1032,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,41 +1051,44 @@ static bool TrackDesignPlaceSceneryElementGetPlaceZ(const TrackDesignSceneryElem _trackDesignPlaceSceneryZ = z; } - ObjectType entry_type; - ObjectEntryIndex entry_index; - TrackDesignPlaceSceneryElementGetEntry(entry_type, entry_index, scenery); - + TrackDesignPlaceSceneryElementGetEntry(scenery); return true; } -static bool TrackDesignPlaceSceneryElement( +static std::optional TrackDesignPlaceSceneryElement( 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 true; + return 0; } if (_trackDesignPlaceOperation == PTD_OPERATION_REMOVE_GHOST && mode == 0) { - return TrackDesignPlaceSceneryElementRemoveGhost(mapCoord, scenery, rotation, originZ); + if (TrackDesignPlaceSceneryElementRemoveGhost(mapCoord, scenery, rotation, originZ)) + return 0; + + return std::nullopt; } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return TrackDesignPlaceSceneryElementGetPlaceZ(scenery); + if (TrackDesignPlaceSceneryElementGetPlaceZ(scenery)) + 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) { - ObjectType entry_type; - ObjectEntryIndex entry_index; - if (TrackDesignPlaceSceneryElementGetEntry(entry_type, entry_index, scenery)) + auto entryInfo = TrackDesignPlaceSceneryElementGetEntry(scenery); + if (!entryInfo) { - return true; + return 0; } money32 cost; @@ -1012,17 +1096,17 @@ static bool TrackDesignPlaceSceneryElement( uint8_t flags; uint8_t quadrant; - switch (entry_type) + switch (entryInfo->Type) { case ObjectType::SmallScenery: { if (mode != 0) { - return true; + return 0; } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return true; + return 0; } rotation += scenery.flags; @@ -1052,7 +1136,7 @@ static bool 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); @@ -1066,11 +1150,11 @@ static bool TrackDesignPlaceSceneryElement( { if (mode != 0) { - return true; + return 0; } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return true; + return 0; } rotation += scenery.flags; @@ -1098,7 +1182,8 @@ static bool 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); @@ -1110,11 +1195,11 @@ static bool TrackDesignPlaceSceneryElement( { if (mode != 0) { - return true; + return 0; } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return true; + return 0; } z = scenery.z * COORDS_Z_STEP + originZ; @@ -1141,7 +1226,7 @@ static bool 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) @@ -1151,19 +1236,16 @@ static bool TrackDesignPlaceSceneryElement( break; } case ObjectType::Paths: + case ObjectType::FootpathSurface: if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return true; + return 0; } 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; @@ -1193,8 +1275,14 @@ static bool TrackDesignPlaceSceneryElement( } uint8_t slope = ((bh >> 5) & 0x3) | ((bh >> 2) & 0x4); uint8_t edges = bh & 0xF; + 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, edges); + { 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); @@ -1205,14 +1293,14 @@ static bool TrackDesignPlaceSceneryElement( { if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE_QUERY) { - return true; + return 0; } auto* pathElement = map_get_path_element_at({ mapCoord.x / 32, mapCoord.y / 32, z }); if (pathElement == nullptr) { - return true; + return 0; } footpath_queue_chain_reset(); @@ -1234,41 +1322,43 @@ static bool TrackDesignPlaceSceneryElement( } footpath_connect_edges(mapCoord, reinterpret_cast(pathElement), flags); footpath_update_queue_chains(); - return true; + return 0; } break; default: _trackDesignPlaceStateSceneryUnavailable = true; - return true; + return 0; } - _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 totalCost; } if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE) { - return true; + return totalCost; } - return false; + return std::nullopt; } - return true; + return totalCost; } /** * * rct2: 0x006D0964 */ -static int32_t track_design_place_all_scenery( - const std::vector& sceneryList, int32_t originX, int32_t originY, int32_t originZ) +static std::optional track_design_place_all_scenery( + const std::vector& sceneryList, const CoordsXYZ& origin) { + money32 cost = 0; + for (uint8_t mode = 0; mode <= 1; mode++) { if (!sceneryList.empty()) @@ -1284,23 +1374,26 @@ 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)) + auto placementCost = TrackDesignPlaceSceneryElement(mapCoord, mode, scenery, rotation, origin.z); + if (!placementCost.has_value() || placementCost == MONEY32_UNDEFINED) { - return 0; + return std::nullopt; } + cost += placementCost.value(); } } - return 1; + + return cost; } -static int32_t track_design_place_maze(TrackDesign* td6, const CoordsXYZ& coords, Ride* ride) +static std::optional track_design_place_maze(TrackDesign* td6, const CoordsXYZ& coords, Ride* ride) { if (_trackDesignPlaceOperation == PTD_OPERATION_DRAW_OUTLINES) { @@ -1310,7 +1403,7 @@ static int32_t track_design_place_maze(TrackDesign* td6, const CoordsXYZ& coords } _trackDesignPlaceZ = 0; - _trackDesignPlaceCost = 0; + money32 totalCost = 0; for (const auto& maze_element : td6->maze_elements) { @@ -1414,7 +1507,7 @@ static int32_t track_design_place_maze(TrackDesign* td6, const CoordsXYZ& coords } 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) { @@ -1447,12 +1540,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::nullopt; } } @@ -1499,10 +1591,10 @@ static int32_t track_design_place_maze(TrackDesign* td6, const CoordsXYZ& coords } _trackPreviewOrigin = coords; - return 1; + return totalCost; } -static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, Ride* ride) +static std::optional track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, Ride* ride) { _trackPreviewOrigin = origin; if (_trackDesignPlaceOperation == PTD_OPERATION_DRAW_OUTLINES) @@ -1513,7 +1605,7 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R } _trackDesignPlaceZ = 0; - _trackDesignPlaceCost = 0; + money32 totalCost = 0; uint8_t rotation = _currentTrackPieceDirection; // Track elements @@ -1521,13 +1613,14 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R for (const auto& track : td6->track_elements) { auto trackType = track.type; + 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 = TrackBlocks[trackType]; 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 }); @@ -1536,8 +1629,8 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R break; case PTD_OPERATION_REMOVE_GHOST: { - const rct_track_coordinates* trackCoordinates = &TrackCoordinates[trackType]; - const rct_preview_track* trackBlock = TrackBlocks[trackType]; + 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) }); @@ -1551,7 +1644,7 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R case PTD_OPERATION_PLACE_GHOST: case PTD_OPERATION_PLACE_TRACK_PREVIEW: { - const rct_track_coordinates* trackCoordinates = &TrackCoordinates[trackType]; + const rct_track_coordinates* trackCoordinates = &ted.Coordinates; // di int16_t tempZ = newCoords.z - trackCoordinates->z_begin; @@ -1599,18 +1692,17 @@ 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::nullopt; } break; } case PTD_OPERATION_GET_PLACE_Z: { - int32_t tempZ = newCoords.z - TrackCoordinates[trackType].z_begin; - for (const rct_preview_track* trackBlock = TrackBlocks[trackType]; 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)) @@ -1621,7 +1713,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::nullopt; } int32_t surfaceZ = surfaceElement->GetBaseZ(); @@ -1649,13 +1741,13 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R } } - const rct_track_coordinates* track_coordinates = &TrackCoordinates[trackType]; + const rct_track_coordinates& track_coordinates = ted.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); } @@ -1694,8 +1786,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::nullopt; } do @@ -1736,12 +1827,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::nullopt; } _trackDesignPlaceStateEntranceExitPlaced = true; break; @@ -1755,14 +1845,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; - } - else - { - _trackDesignPlaceCost += res->Cost; - _trackDesignPlaceStateEntranceExitPlaced = true; + return std::nullopt; } + + totalCost += res->Cost; + _trackDesignPlaceStateEntranceExitPlaced = true; } break; } @@ -1771,10 +1858,10 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R if (_trackDesignPlaceOperation == PTD_OPERATION_REMOVE_GHOST) { - sub_6CB945(ride); + ride->ValidateStations(); ride->Delete(); } - return true; + return totalCost; } /** @@ -1790,7 +1877,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; @@ -1811,24 +1898,26 @@ int32_t place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeSc _trackPreviewMax = coords; _trackDesignPlaceSceneryZ = 0; - uint8_t track_place_success = 0; + std::optional trackPlaceCost; if (td6->type == RIDE_TYPE_MAZE) { - track_place_success = track_design_place_maze(td6, coords, ride); + trackPlaceCost = track_design_place_maze(td6, coords, ride); } else { - track_place_success = track_design_place_ride(td6, coords, ride); + trackPlaceCost = track_design_place_ride(td6, coords, ride); } // Scenery elements - if (track_place_success) + if (trackPlaceCost.has_value()) { - if (!track_design_place_all_scenery( - td6->scenery_elements, _trackPreviewOrigin.x, _trackPreviewOrigin.y, _trackPreviewOrigin.z)) + auto sceneryCost = track_design_place_all_scenery(td6->scenery_elements, _trackPreviewOrigin); + if (!sceneryCost.has_value()) { - return _trackDesignPlaceCost; + return MONEY32_UNDEFINED; } + + trackPlaceCost = trackPlaceCost.value() + sceneryCost.value(); } // 0x6D0FE6 @@ -1846,7 +1935,8 @@ int32_t place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeSc // from _trackDesignPlaceZ, causing bug #259. return _trackDesignPlaceZ - _trackDesignPlaceSceneryZ; } - return _trackDesignPlaceCost; + + 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) @@ -1855,8 +1945,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) @@ -1864,7 +1953,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; } @@ -1880,12 +1969,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; @@ -1899,7 +1984,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++) { @@ -1920,14 +2011,15 @@ 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; 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(PreviewRideId), { mapSize, mapSize, 16 }); if (_trackDesignPlaceStateHasScenery) { @@ -1949,7 +2041,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; } @@ -1959,18 +2051,16 @@ 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; } - else - { - _currentTrackPieceDirection = backup_rotation; - ride->Delete(); - byte_9D8150 = false; - return false; - } + + _currentTrackPieceDirection = backup_rotation; + ride->Delete(); + _trackDesignDrawingPreview = false; + return false; } #pragma region Track Design Preview @@ -2057,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; } @@ -2089,8 +2170,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/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index a1161469c0..eabc486918 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" @@ -33,13 +32,18 @@ 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 + { + return (flags & (1 << 7)) != 0; + } }; /** @@ -115,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]; @@ -192,20 +196,21 @@ enum MAZE_ELEMENT_TYPE_EXIT = (1 << 7) }; -extern TrackDesign* gActiveTrackDesign; +static constexpr ride_id_t PreviewRideId = static_cast(0); + extern bool gTrackDesignSceneryToggle; -extern bool byte_9D8150; +extern bool _trackDesignDrawingPreview; 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); -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 @@ -226,5 +231,3 @@ bool track_design_are_entrance_and_exit_placed(); extern std::vector _trackSavedTileElementsDesc; extern std::vector _trackSavedTileElements; - -#endif diff --git a/src/openrct2/ride/TrackDesignRepository.cpp b/src/openrct2/ride/TrackDesignRepository.cpp index 9af88aa3b8..468fcb14b9 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)) { @@ -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/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/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index cf3dde9395..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) + 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) +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->GetSurfaceEntryIndex(); - 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); @@ -385,7 +454,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; @@ -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->GetSurfaceEntryIndex(); - 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); + } } /** @@ -547,7 +624,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/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 0fa437a2ba..1b135afaad 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" @@ -27,13 +28,14 @@ #include "TrackData.h" #include "TrackDesign.h" -// clang-format off +using namespace OpenRCT2::TrackMetaData; + /* rct2: 0x007667AC */ static constexpr TileCoordsXY EntranceOffsetEdgeNE[] = { { -1, 0 }, - { 0, -1 }, - { 1, 0 }, - { 0, 1 }, + { 0, -1 }, + { 1, 0 }, + { 0, 1 }, }; /* rct2: 0x007667AE */ @@ -45,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[] = { @@ -59,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, @@ -76,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, @@ -100,54 +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, +}; + +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, 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, }; 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, } }; @@ -164,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 @@ -199,11 +229,14 @@ 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 TileElement* tileElement, 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) + return false; + TileCoordsXY offset; switch (edge) { @@ -223,7 +256,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); @@ -231,8 +264,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) @@ -256,27 +293,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, 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 }); @@ -296,40 +333,42 @@ 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, - const TileElement* tileElement, int32_t fenceOffsetA, int32_t fenceOffsetB); + paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, + const TrackElement& trackElement, 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 TrackElement& trackElement) { - 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, trackElement, 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 TrackElement& trackElement, 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, trackElement, fenceOffsetA, fenceOffsetB); } void track_paint_util_draw_station_3( - paint_session* session, ride_id_t rideIndex, Direction direction, uint16_t height, uint16_t coverHeight, - const TileElement* tileElement) + paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement, int32_t fenceOffsetA, int32_t fenceOffsetB) + paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, + const TrackElement& trackElement, int32_t fenceOffsetA, int32_t fenceOffsetB) { - auto ride = get_ride(rideIndex); 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; bool hasFence; uint32_t imageId; @@ -337,9 +376,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) { @@ -354,7 +393,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]; @@ -369,12 +408,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]; } @@ -385,14 +424,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]; } @@ -402,13 +441,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]; @@ -418,12 +457,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 }); @@ -432,9 +471,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) { @@ -449,7 +488,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]; @@ -464,12 +503,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]; } @@ -480,14 +519,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]; } @@ -497,13 +536,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]; @@ -514,12 +553,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 }); @@ -528,16 +567,18 @@ 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 TrackElement& trackElement, uint8_t stationVariant) { - auto ride = get_ride(rideIndex); 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; bool hasFence; uint32_t imageId; @@ -545,9 +586,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) { @@ -562,7 +603,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]; @@ -577,12 +618,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]; } @@ -593,14 +634,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]; } @@ -610,13 +651,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]; @@ -626,12 +667,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 }); @@ -640,9 +681,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) { @@ -657,7 +698,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]; @@ -672,12 +713,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]; } @@ -688,14 +729,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]; } @@ -705,13 +746,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]; @@ -722,12 +763,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 }); @@ -817,9 +858,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), bounds.x, bounds.y, - static_cast(bounds.z), offset.z, boundsOffset.x, boundsOffset.y, boundsOffset.z); + PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); uint32_t edi = session->TrackColours[SCHEME_TRACK] & (0b11111 << 19); @@ -832,20 +871,22 @@ 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); + PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); return true; } -void track_paint_util_draw_station_platform( - paint_session* session, Ride* ride, Direction direction, int32_t height, int32_t zOffset, const TileElement* tileElement) +void track_paint_util_draw_narrow_station_platform( + paint_session* session, const Ride* ride, Direction direction, int32_t height, int32_t zOffset, + const TrackElement& trackElement) { 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); + 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 }); @@ -854,7 +895,7 @@ void track_paint_util_draw_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]; @@ -864,7 +905,7 @@ void track_paint_util_draw_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 }); @@ -873,7 +914,7 @@ void track_paint_util_draw_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]; @@ -884,15 +925,18 @@ void track_paint_util_draw_station_platform( } 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) + paint_session* session, const Ride* ride, const StationObject* stationObj, const CoordsXY& position, Direction direction, + int32_t height, const TrackElement& trackElement, uint8_t rotation) { + if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) + return; + bool hasFence; uint32_t imageId; 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 }); @@ -901,7 +945,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]; @@ -911,7 +955,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 }); @@ -920,7 +964,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]; @@ -996,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, @@ -1017,8 +1066,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, { offset, height }, { boundsLength, thickness[0] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } if (sprites[direction][index][1] != 0) { @@ -1028,8 +1077,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, { offset, height }, { boundsLength, thickness[1] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } } @@ -1095,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], @@ -1115,8 +1166,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, { offset, height }, { boundsLength, thickness[0] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } if (sprites[direction][index][1] != 0) { @@ -1126,8 +1177,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, { offset, height }, { boundsLength, thickness[1] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } } @@ -1266,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], @@ -1286,8 +1341,8 @@ 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, { offset.x, offset.y, height }, { boundsLength.x, boundsLength.y, thickness[direction][index] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } constexpr CoordsXY defaultDiagTileOffsets[4] = { @@ -1327,8 +1382,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, { offset, height }, { boundsLength, thickness }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } const uint8_t mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[] = { @@ -1449,8 +1504,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( @@ -1464,11 +1519,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->bb_offset; 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, { 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( @@ -1482,10 +1538,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( @@ -1521,7 +1576,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]); } } @@ -1625,8 +1680,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, { 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( @@ -1735,11 +1790,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->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, { 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( @@ -1753,10 +1808,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( @@ -2010,7 +2064,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]; @@ -2041,7 +2095,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 }, @@ -2050,7 +2104,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) @@ -2079,7 +2133,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 }, @@ -2088,7 +2142,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) @@ -2163,9 +2217,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) { @@ -2176,14 +2230,15 @@ 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)) { session->InteractionType = ViewportInteractionItem::None; - if (TrackHeightMarkerPositions[trackType] & (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 @@ -2206,7 +2261,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 @@ -2216,14 +2271,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; @@ -2237,13 +2292,15 @@ void track_paint(paint_session* session, Direction direction, int32_t height, co { 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); if (paintFunction != nullptr) { - paintFunction(session, rideIndex, 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 07cac144dd..6c28ff0e73 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" @@ -241,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]; @@ -278,34 +280,36 @@ 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 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]); + 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 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); 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( - paint_session* session, Ride* ride, Direction direction, int32_t height, int32_t zOffset, const TileElement* tileElement); +void track_paint_util_draw_narrow_station_platform( + paint_session* session, const Ride* ride, Direction direction, int32_t height, int32_t zOffset, + const TrackElement& trackElement); 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 TrackElement& trackElement); 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 TrackElement& trackElement, 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, - const TileElement* tileElement); + paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, + const TrackElement& trackElement); 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 TrackElement& trackElement, 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, - int32_t height, const TileElement* tileElement, uint8_t rotation); + paint_session* session, const Ride* ride, const StationObject* stationObject, const CoordsXY& position, Direction direction, + 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( @@ -362,9 +366,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], @@ -393,8 +397,8 @@ 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, - const TileElement* tileElement); + paint_session* session, const Ride* ride, uint8_t trackSequence, Direction direction, int32_t height, + 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); @@ -477,5 +481,3 @@ namespace SingleRailRC { TRACK_PAINT_FUNCTION GetTrackPaintFunction(int32_t trackType); } - -#endif 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 0a9f05e8ed..0e7f1388b5 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" @@ -48,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; @@ -69,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, @@ -282,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 @@ -446,298 +429,163 @@ 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 SpriteBase::Is() const +template<> bool EntityBase::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) { @@ -933,22 +781,23 @@ 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) return false; - if (sprite_left == LOCATION_NULL) + if (x == LOCATION_NULL) return false; 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) { @@ -956,11 +805,11 @@ 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; - 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) { @@ -968,7 +817,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; @@ -998,7 +847,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; @@ -1009,7 +858,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; @@ -1377,7 +1226,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()) @@ -1495,17 +1344,24 @@ bool Vehicle::OpenRestraints() } if (vehicleEntry->animation == VEHICLE_ENTRY_ANIMATION_OBSERVATION_TOWER && vehicle->animation_frame != 0) { - if (vehicle->var_C8 + 0x3333 < 0xFFFF) + if (vehicle->animationState <= 0xCCCC) { - vehicle->var_C8 = vehicle->var_C8 + 0x3333 - 0xFFFF; + vehicle->animationState += 0x3333; + } + else + { + vehicle->animationState = 0; vehicle->animation_frame++; vehicle->animation_frame &= 7; vehicle->Invalidate(); } - else - { - vehicle->var_C8 += 0x3333; - } + restraintsOpen = false; + continue; + } + if (vehicleEntry->animation == VEHICLE_ENTRY_ANIMATION_ANIMAL_FLYING + && (vehicle->animation_frame != 0 || vehicle->animationState > 0)) + { + vehicle->UpdateAnimationAnimalFlying(); restraintsOpen = false; continue; } @@ -1565,14 +1421,14 @@ 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, EnumValue(ride)); return; } 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; @@ -1631,7 +1487,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(); @@ -1679,7 +1535,8 @@ void Vehicle::UpdateMeasurements() } } - uint16_t trackFlags = TrackFlags[trackElemType]; + 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) @@ -1846,7 +1703,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) @@ -1861,7 +1718,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; @@ -1891,7 +1748,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; @@ -1947,12 +1804,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 @@ -2271,7 +2126,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; } @@ -2296,7 +2151,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; @@ -2304,7 +2159,7 @@ void Vehicle::UpdateWaitingForPassengers() } auto trainIndex = ride_get_train_index_from_vehicle(curRide, sprite_index); - if (!trainIndex) + if (!trainIndex.has_value()) { return; } @@ -2312,14 +2167,14 @@ 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; Invalidate(); return; } - else if (sub_state == 1) + if (sub_state == 1) { if (time_waiting != 0xFFFF) time_waiting++; @@ -2532,7 +2387,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; @@ -2546,7 +2401,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; @@ -2994,13 +2849,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; } } } @@ -3078,7 +2931,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, EnumValue(ride.id)); } void Vehicle::UpdateTestFinish() @@ -3108,7 +2961,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; @@ -3128,7 +2981,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, EnumValue(ride.id)); } void Vehicle::TestReset() @@ -3242,12 +3095,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)) @@ -3341,13 +3194,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; @@ -3460,7 +3313,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) @@ -3468,7 +3321,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()) @@ -3534,7 +3387,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, EnumValue(ride), ft); } } @@ -3571,12 +3424,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) { @@ -3598,25 +3451,29 @@ void Vehicle::UpdateCollisionSetup() train->sub_state = 2; - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, { train->x, train->y, train->z }); +#ifdef ENABLE_SCRIPTING + InvokeVehicleCrashHook(train->sprite_index, "another_vehicle"); +#endif + const auto trainLoc = train->GetLocation(); - ExplosionCloud::Create({ train->x, train->y, train->z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, trainLoc); + + 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; - train->var_C8 = scenario_rand(); - train->var_CA = scenario_rand(); + train->animationState = scenario_rand() & 0xFFFF; - train->animation_frame = train->var_CA & 0x7; + train->animation_frame = scenario_rand() & 0x7; train->sprite_width = 13; train->sprite_height_negative = 45; train->sprite_height_positive = 5; - train->MoveTo({ train->x, train->y, train->z }); + train->MoveTo(trainLoc); train->SwingSpeed = 0; } @@ -3659,7 +3516,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; @@ -3788,7 +3645,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; @@ -4096,7 +3953,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); @@ -4161,7 +4018,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; @@ -4349,7 +4206,7 @@ void Vehicle::TryReconnectBoatToTrack(const CoordsXY& currentBoatLocation, const { SetTrackType(trackElement->GetTrackType()); SetTrackDirection(curRide->boat_hire_return_direction); - BoatLocation.setNull(); + BoatLocation.SetNull(); } track_progress = 0; @@ -4386,9 +4243,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 (;;) @@ -5089,24 +4944,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; } } @@ -5266,7 +5121,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, EnumValue(ride->id), + ft); } if (gParkRatingCasualtyPenalty < 500) @@ -5334,16 +5190,20 @@ 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(); 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) { @@ -5361,24 +5221,26 @@ 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; - var_C8 = 0; + animationState = 0; sprite_width = 13; sprite_height_negative = 45; sprite_height_positive = 5; - MoveTo({ x, y, z }); + MoveTo(curLoc); crash_z = 0; } @@ -5396,16 +5258,20 @@ 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(); 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) { @@ -5423,25 +5289,27 @@ 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; - var_C8 = 0; + animationState = 0; sprite_width = 13; sprite_height_negative = 45; sprite_height_positive = 5; - MoveTo({ x, y, z }); + MoveTo(curLoc); crash_z = -1; } @@ -5455,6 +5323,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) @@ -5464,21 +5334,26 @@ 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->var_C8 + 7281 > 0xFFFF) + if (curVehicle->animationState <= 0xe388) { + curVehicle->animationState += 0x1c71; + } + else + { + curVehicle->animationState = 0; curVehicle->animation_frame++; if (curVehicle->animation_frame >= 8) curVehicle->animation_frame = 0; curVehicle->Invalidate(); } - curVehicle->var_C8 += 7281; 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; @@ -5489,12 +5364,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(); @@ -5502,8 +5377,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; @@ -5511,20 +5386,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) { @@ -6870,10 +6743,7 @@ int32_t Vehicle::GetSwingAmount() const { return 14; } - else - { - return -15; - } + return -15; case TrackElemType::SBendRight: case TrackElemType::SBendRightCovered: @@ -6882,10 +6752,7 @@ int32_t Vehicle::GetSwingAmount() const { return -14; } - else - { - return 15; - } + return 15; case TrackElemType::LeftQuarterTurn3Tiles: case TrackElemType::LeftBankedQuarterTurn3Tiles: @@ -6950,32 +6817,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; @@ -7073,50 +6940,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 @@ -7141,7 +6964,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 @@ -7230,17 +7055,47 @@ void Vehicle::UpdateSpinningCar() Invalidate(); } +void Vehicle::UpdateAnimationAnimalFlying() +{ + if (animationState > 0) + { + animationState--; + return; + } + + 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 */ 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); auto vehicleEntry = Entry(); if (vehicleEntry == nullptr) { @@ -7249,16 +7104,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) + animationState += _vehicleVelocityF64E08; + targetFrame = (animationState >> 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) @@ -7289,74 +7143,74 @@ void Vehicle::UpdateAdditionalAnimation() } break; case VEHICLE_ENTRY_ANIMATION_SWAN: // loc_6D6424 - *curVar_C8 += _vehicleVelocityF64E08; - al = (*curVar_C8 >> 18) & 2; - if (animation_frame != al) + animationState += _vehicleVelocityF64E08; + targetFrame = (animationState >> 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) + animationState += _vehicleVelocityF64E08; + eax = ((animationState >> 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) + animationState += _vehicleVelocityF64E08; + eax = ((animationState >> 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) + animationState += _vehicleVelocityF64E08; + targetFrame = (animationState >> 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 = 0; 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) + animationState += _vehicleVelocityF64E08; + targetFrame = (animationState >> 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) + animationState += _vehicleVelocityF64E08; + eax = ((animationState >> 13) & 0xFF) << 2; + targetFrame = (eax >> 8) & 0xFF; + if (animation_frame != targetFrame) { - animation_frame = ah; + animation_frame = targetFrame; Invalidate(); } } @@ -7364,13 +7218,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 = 0; if (seat_rotation >= target_seat_rotation) seat_rotation--; @@ -7383,6 +7237,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, 0u); + break; } } @@ -7454,12 +7314,13 @@ static void AnimateSceneryDoor(const CoordsXYZD& doorLocation, const CoordsXYZ& void Vehicle::UpdateSceneryDoor() const { auto trackType = GetTrackType(); - const rct_preview_track* trackBlock = TrackBlocks[trackType]; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = ted.Block; while ((trackBlock + 1)->index != 255) { trackBlock++; } - const rct_track_coordinates* trackCoordinates = &TrackCoordinates[trackType]; + 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; @@ -7512,7 +7373,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() @@ -7551,8 +7413,9 @@ static void trigger_on_ride_photo(const CoordsXYZ& loc, TileElement* tileElement void Vehicle::UpdateSceneryDoorBackwards() const { auto trackType = GetTrackType(); - const rct_preview_track* trackBlock = TrackBlocks[trackType]; - const rct_track_coordinates* trackCoordinates = &TrackCoordinates[trackType]; + 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); @@ -7890,7 +7753,8 @@ void Vehicle::Sub6DBF3E() } auto trackType = GetTrackType(); - if (!(TrackSequenceProperties[trackType][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& ted = GetTrackElementDescriptor(trackType); + if (!(ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return; } @@ -8384,8 +8248,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) }; } /** @@ -8503,7 +8367,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& ted = GetTrackElementDescriptor(trackType); + if (!(ted.Flags & TRACK_ELEM_FLAG_DOWN)) { _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_9; } @@ -8727,18 +8592,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); @@ -8746,7 +8611,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; } @@ -8754,11 +8619,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); @@ -8766,7 +8631,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; } @@ -8774,11 +8639,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; @@ -8791,15 +8656,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 @@ -8883,12 +8748,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 { @@ -8906,53 +8771,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: @@ -9164,7 +9032,8 @@ loc_6DCE02: } { auto trackType = GetTrackType(); - if (!(TrackSequenceProperties[trackType][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& ted = GetTrackElementDescriptor(trackType); + if (!(ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return; } @@ -9220,10 +9089,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) @@ -9554,16 +9421,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) { @@ -9574,16 +9439,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); @@ -9764,7 +9627,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; @@ -9784,7 +9647,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()) @@ -9835,7 +9698,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; @@ -9852,7 +9715,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/Vehicle.h b/src/openrct2/ride/Vehicle.h index d9fa5b711e..2146af930d 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -7,14 +7,13 @@ * 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" #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" @@ -52,7 +51,9 @@ struct SoundIdVolume; constexpr const uint16_t VehicleTrackDirectionMask = 0b0000000000000011; constexpr const uint16_t VehicleTrackTypeMask = 0b1111111111111100; -struct Vehicle : SpriteBase +enum class MiniGolfAnimation : uint8_t; + +struct Vehicle : EntityBase { static constexpr auto cEntityType = EntityType::Vehicle; @@ -62,7 +63,7 @@ struct Vehicle : SpriteBase Tail, }; - enum class Status + enum class Status : uint8_t { MovingToEndOfStation, WaitingForPassengers, @@ -181,8 +182,7 @@ struct Vehicle : SpriteBase }; uint8_t animation_frame; uint8_t pad_C6[0x2]; - uint16_t var_C8; - uint16_t var_CA; + uint32_t animationState; OpenRCT2::Audio::SoundId scream_sound_id; VehicleTrackSubposition TrackSubposition; union @@ -198,7 +198,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; @@ -323,6 +323,7 @@ private: void UpdateCrashSetup(); void UpdateCollisionSetup(); int32_t UpdateMotionDodgems(); + void UpdateAnimationAnimalFlying(); void UpdateAdditionalAnimation(); void CheckIfMissing(); bool CurrentTowerElementIsTop(); @@ -376,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 @@ -437,7 +472,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 @@ -563,5 +599,3 @@ extern int32_t _vehicleUnkF64E10; extern uint8_t _vehicleF64E2C; extern Vehicle* _vehicleFrontVehicle; extern CoordsXYZ unk_F64E20; - -#endif 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/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.cpp b/src/openrct2/ride/VehiclePaint.cpp index cd9ddfa79f..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( @@ -918,7 +959,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 +3186,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/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/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/coaster/AirPoweredVerticalCoaster.cpp b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp index 920876083d..74cccfbcfa 100644 --- a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp +++ b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp @@ -177,8 +177,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_AIR_POWERED_VERTICAL_RC_FLAT_SW_NE, @@ -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); @@ -199,8 +199,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -216,11 +216,10 @@ 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]); - 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, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -229,8 +228,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][5] = { { @@ -260,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( @@ -312,18 +311,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -341,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); @@ -351,8 +349,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -370,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); @@ -379,25 +377,23 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][5] = { { @@ -427,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( @@ -493,18 +489,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_AIR_POWERED_VERTICAL_RC_LEFT_BANK_SW_NE, @@ -523,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); @@ -532,15 +528,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static void air_powered_vertical_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_AIR_POWERED_VERTICAL_RC_BRAKES_NW_SE, @@ -552,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); @@ -561,8 +557,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t trackImageIds[7][4] = { { @@ -649,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]; @@ -664,7 +666,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); @@ -688,7 +690,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) { @@ -712,13 +714,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) @@ -750,7 +751,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); @@ -761,8 +762,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -798,25 +799,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); return; } 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; @@ -881,28 +889,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { air_powered_vertical_rc_track_vertical_slope_up( - session, rideIndex, 6 - trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, 6 - trackSequence, (direction + 2) & 3, height, trackElement); } static void air_powered_vertical_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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; @@ -923,14 +931,14 @@ 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); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_AIR_POWERED_VERTICAL_RC_FLAT_SW_NE, @@ -942,9 +950,9 @@ 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, 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 07f7d83ba4..0c1961b44a 100644 --- a/src/openrct2/ride/coaster/BobsleighCoaster.cpp +++ b/src/openrct2/ride/coaster/BobsleighCoaster.cpp @@ -32,10 +32,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -90,8 +90,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -114,10 +114,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -200,10 +200,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -286,10 +286,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -372,32 +372,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -620,17 +620,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -671,8 +671,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -713,8 +713,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -755,8 +755,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -797,8 +797,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1021,17 +1021,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1079,8 +1079,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1128,8 +1128,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1177,8 +1177,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1226,40 +1226,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1300,16 +1300,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1491,8 +1491,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1674,8 +1674,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1813,17 +1813,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1961,17 +1961,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2242,8 +2242,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2514,8 +2514,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -2524,13 +2524,13 @@ static void bobsleigh_rc_track_left_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bobsleigh_rc_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -2538,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2986,8 +2985,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3428,8 +3427,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3438,13 +3437,13 @@ static void bobsleigh_rc_track_left_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bobsleigh_rc_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3452,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3490,10 +3488,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); switch (direction) { case 0: @@ -3524,8 +3522,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3568,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 55bdd29ef7..1f866445e7 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp @@ -33,12 +33,17 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + 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, @@ -68,8 +78,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { static constexpr const uint32_t imageIds[4][2] = { { 17154, SPR_STATION_BASE_A_SW_NE }, @@ -78,9 +88,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); @@ -96,9 +106,8 @@ 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_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,10 +115,10 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -175,10 +184,10 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -244,10 +253,10 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -313,10 +322,10 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -390,10 +399,10 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -467,10 +476,10 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -536,56 +545,54 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, supportType); } void bolliger_mabillard_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -747,17 +754,17 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -793,8 +800,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -830,8 +837,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -867,8 +874,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -904,8 +911,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -1080,17 +1087,17 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -1133,8 +1140,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -1177,8 +1184,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -1221,8 +1228,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -1265,40 +1272,40 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, supportType); } void bolliger_mabillard_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -1330,16 +1337,15 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -1501,8 +1507,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -1664,26 +1670,26 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, supportType); } void bolliger_mabillard_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -1812,8 +1818,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -1942,8 +1948,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2204,8 +2210,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2428,8 +2434,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2530,17 +2536,17 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2650,17 +2656,17 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2737,8 +2743,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2818,26 +2824,26 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -3053,8 +3059,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -3270,8 +3276,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { if (trackSequence >= 4) { @@ -3280,12 +3286,12 @@ 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { if (trackSequence >= 4) { @@ -3294,12 +3300,12 @@ 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -3639,8 +3645,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -3986,8 +3992,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { if (trackSequence >= 7) { @@ -3996,12 +4002,12 @@ 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { if (trackSequence >= 7) { @@ -4010,12 +4016,12 @@ 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4050,8 +4056,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4086,24 +4092,24 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, supportType); } void bolliger_mabillard_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4129,8 +4135,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4169,8 +4175,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4209,8 +4215,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4243,31 +4249,31 @@ 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); } 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, supportType); } void bolliger_mabillard_track_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4306,16 +4312,15 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4356,16 +4361,16 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4401,8 +4406,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4444,8 +4449,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4578,8 +4583,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4711,26 +4716,26 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4866,8 +4871,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -5003,31 +5008,31 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, supportType); } void bolliger_mabillard_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5054,7 +5059,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) { @@ -5081,7 +5086,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) { @@ -5108,7 +5113,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) { @@ -5166,13 +5171,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5199,7 +5204,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) { @@ -5226,7 +5231,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) { @@ -5253,7 +5258,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) { @@ -5311,13 +5316,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5344,7 +5349,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) { @@ -5371,7 +5376,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) { @@ -5398,7 +5403,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) { @@ -5456,13 +5461,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5489,7 +5494,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) { @@ -5516,7 +5521,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) { @@ -5543,7 +5548,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) { @@ -5601,13 +5606,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5634,7 +5639,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) { @@ -5661,7 +5666,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) { @@ -5688,7 +5693,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) { @@ -5746,13 +5751,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5779,7 +5784,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) { @@ -5806,7 +5811,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) { @@ -5833,7 +5838,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) { @@ -5891,13 +5896,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5924,7 +5929,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) { @@ -5951,7 +5956,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) { @@ -5978,7 +5983,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) { @@ -6036,13 +6041,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6069,7 +6074,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) { @@ -6096,7 +6101,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) { @@ -6123,7 +6128,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) { @@ -6181,13 +6186,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6214,7 +6219,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) { @@ -6241,7 +6246,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) { @@ -6268,7 +6273,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) { @@ -6326,13 +6331,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6358,7 +6363,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) { @@ -6384,7 +6389,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) { @@ -6410,7 +6415,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) { @@ -6469,13 +6474,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6502,7 +6507,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) { @@ -6529,7 +6534,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) { @@ -6556,7 +6561,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) { @@ -6614,13 +6619,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6647,7 +6652,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) { @@ -6674,7 +6679,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) { @@ -6701,7 +6706,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) { @@ -6759,13 +6764,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6792,7 +6797,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) { @@ -6819,7 +6824,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) { @@ -6846,7 +6851,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) { @@ -6904,13 +6909,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6937,7 +6942,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) { @@ -6964,7 +6969,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) { @@ -6991,7 +6996,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) { @@ -7049,13 +7054,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7082,7 +7087,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) { @@ -7109,7 +7114,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) { @@ -7136,7 +7141,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) { @@ -7194,13 +7199,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7227,7 +7232,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) { @@ -7254,7 +7259,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) { @@ -7281,7 +7286,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) { @@ -7339,13 +7344,13 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7372,7 +7377,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) { @@ -7399,7 +7404,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) { @@ -7426,7 +7431,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) { @@ -7484,8 +7489,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7558,8 +7563,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7632,8 +7637,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7706,8 +7711,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7780,8 +7785,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7854,8 +7859,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7928,8 +7933,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8002,8 +8007,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8076,8 +8081,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8148,8 +8153,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8220,8 +8225,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8294,8 +8299,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8368,8 +8373,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8439,8 +8444,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8510,8 +8515,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8591,8 +8596,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8675,8 +8680,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8759,8 +8764,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8840,10 +8845,10 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); switch (direction) { case 0: @@ -8872,8 +8877,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8953,8 +8958,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -9037,26 +9042,26 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -9224,8 +9229,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -9393,26 +9398,26 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9453,8 +9458,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9495,8 +9500,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9537,8 +9542,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9579,40 +9584,40 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9651,8 +9656,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9691,8 +9696,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9731,8 +9736,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9771,40 +9776,40 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9845,8 +9850,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9887,8 +9892,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9929,8 +9934,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9971,40 +9976,40 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10049,8 +10054,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10095,27 +10100,27 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10187,10 +10192,10 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10262,24 +10267,24 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, supportType); } void bolliger_mabillard_track_brake_for_drop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -10320,8 +10325,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10444,15 +10449,15 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, supportType); } void bolliger_mabillard_track_left_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10561,8 +10566,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10672,24 +10677,24 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, supportType); } void bolliger_mabillard_track_right_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10825,8 +10830,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10961,24 +10966,24 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -11116,8 +11121,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -11255,24 +11260,24 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, supportType); } void bolliger_mabillard_track_powered_lift( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -11308,8 +11313,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -11528,8 +11533,8 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -11748,24 +11753,24 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -11861,16 +11866,16 @@ 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, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, trackElement, supportType); } void bolliger_mabillard_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 21fb3961b2..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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement, int32_t supportType); diff --git a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp index 96c6c68aad..19923553d0 100644 --- a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp +++ b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp @@ -20,10 +20,10 @@ /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -74,8 +74,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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,10 +101,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -195,10 +195,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -265,10 +265,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -359,10 +359,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -441,10 +441,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -547,10 +547,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -641,58 +641,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -871,17 +869,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -923,8 +921,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -966,8 +964,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1009,8 +1007,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1052,8 +1050,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1232,18 +1230,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1309,8 +1307,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1376,8 +1374,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1443,8 +1441,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1510,44 +1508,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1589,16 +1583,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1762,8 +1756,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1927,28 +1921,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2118,8 +2112,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2289,8 +2283,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2596,8 +2590,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2903,8 +2897,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3022,17 +3016,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3151,18 +3145,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3248,8 +3241,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3335,28 +3328,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3465,8 +3458,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3575,8 +3568,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3685,8 +3678,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3795,8 +3788,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3948,16 +3941,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4074,8 +4067,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4192,26 +4185,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4251,8 +4242,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4293,26 +4284,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4344,8 +4335,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4529,8 +4520,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4714,8 +4705,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4899,8 +4890,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5084,8 +5075,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -5130,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); @@ -5138,13 +5129,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5208,21 +5199,21 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5290,19 +5281,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5370,13 +5360,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5443,8 +5433,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5606,8 +5596,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5769,26 +5759,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5950,8 +5940,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6113,33 +6103,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; compact_inverted_rc_track_right_eighth_bank_to_diag( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6166,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) { @@ -6193,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) { @@ -6220,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) { @@ -6272,13 +6261,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6305,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) { @@ -6332,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) { @@ -6359,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) { @@ -6411,8 +6400,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6494,13 +6483,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6527,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) { @@ -6554,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) { @@ -6581,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) { @@ -6633,8 +6622,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6716,8 +6705,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6799,13 +6788,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6832,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) { @@ -6859,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) { @@ -6886,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) { @@ -6938,13 +6927,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6971,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) { @@ -6998,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) { @@ -7025,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) { @@ -7077,8 +7066,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7160,13 +7149,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7192,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) { @@ -7218,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) { @@ -7244,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) { @@ -7296,8 +7285,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7379,8 +7368,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7462,13 +7451,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7495,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) { @@ -7522,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) { @@ -7549,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) { @@ -7601,8 +7590,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7685,8 +7674,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7769,8 +7758,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7853,8 +7842,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7937,8 +7926,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8020,8 +8009,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8103,8 +8092,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8186,8 +8175,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8269,8 +8258,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8349,8 +8338,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8429,8 +8418,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8512,8 +8501,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8595,8 +8584,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8679,8 +8668,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8763,8 +8752,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { diff --git a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp index f3bd5c62e2..ce745ef622 100644 --- a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp @@ -32,10 +32,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -89,8 +89,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -123,10 +123,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -193,10 +193,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -263,10 +263,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -333,10 +333,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -411,10 +411,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -489,10 +489,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -559,56 +559,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -771,17 +771,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -818,8 +818,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -856,8 +856,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -894,8 +894,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -932,8 +932,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1106,17 +1106,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1160,8 +1160,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1205,8 +1205,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1250,8 +1250,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1295,40 +1295,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1361,16 +1361,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1533,8 +1533,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1697,28 +1697,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1852,8 +1850,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1987,8 +1985,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2266,8 +2264,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2499,8 +2497,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2602,17 +2600,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2723,17 +2721,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2811,8 +2809,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2897,28 +2895,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3046,16 +3042,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3166,8 +3162,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3279,24 +3275,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3513,8 +3509,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3731,8 +3727,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3741,13 +3737,13 @@ static void corkscrew_rc_track_left_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; corkscrew_rc_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3755,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4103,8 +4098,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4445,8 +4440,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4455,13 +4450,13 @@ static void corkscrew_rc_track_left_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; corkscrew_rc_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4469,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4512,8 +4506,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4549,26 +4543,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** rct2: 0x008A7F38 */ static void corkscrew_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4595,8 +4587,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4629,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); @@ -4637,8 +4629,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4778,8 +4770,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4919,26 +4911,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5076,8 +5066,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5214,26 +5204,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5374,8 +5364,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5515,31 +5505,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5566,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) { @@ -5593,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) { @@ -5620,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) { @@ -5679,13 +5669,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5712,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) { @@ -5739,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) { @@ -5766,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) { @@ -5825,13 +5815,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5858,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) { @@ -5885,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) { @@ -5912,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) { @@ -5971,13 +5961,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6004,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) { @@ -6031,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) { @@ -6058,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) { @@ -6117,13 +6107,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6150,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) { @@ -6177,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) { @@ -6204,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) { @@ -6263,13 +6253,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6296,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) { @@ -6323,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) { @@ -6350,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) { @@ -6409,13 +6399,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6442,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) { @@ -6469,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) { @@ -6496,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) { @@ -6555,13 +6545,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6588,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) { @@ -6615,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) { @@ -6642,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) { @@ -6701,13 +6691,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6734,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) { @@ -6761,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) { @@ -6788,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) { @@ -6847,13 +6837,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6879,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) { @@ -6905,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) { @@ -6931,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) { @@ -6991,13 +6981,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7024,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) { @@ -7051,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) { @@ -7078,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) { @@ -7137,13 +7127,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7170,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) { @@ -7197,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) { @@ -7224,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) { @@ -7283,13 +7273,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7316,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) { @@ -7343,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) { @@ -7370,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) { @@ -7429,8 +7419,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7508,8 +7498,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7587,8 +7577,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7666,8 +7656,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7745,8 +7735,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7824,8 +7814,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7903,8 +7893,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7982,8 +7972,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8061,8 +8051,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8138,8 +8128,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8215,8 +8205,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8294,8 +8284,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8373,8 +8363,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8449,8 +8439,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8525,10 +8515,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -8540,12 +8530,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (!is_csg_loaded()) { - corkscrew_rc_track_brakes(session, rideIndex, 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 df2a5b8c97..4beab24b3c 100644 --- a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp @@ -21,12 +21,12 @@ /** rct2: 0x007C6FF4 */ static void flying_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -133,10 +133,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, rideIndex, 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); @@ -190,12 +190,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -350,10 +350,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -432,12 +432,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -592,10 +592,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -684,10 +684,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -800,12 +800,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -960,58 +960,58 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -1377,19 +1377,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1467,10 +1467,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1548,10 +1548,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1629,10 +1629,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1710,10 +1710,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -2080,19 +2080,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2201,10 +2201,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2313,10 +2313,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2425,10 +2425,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2537,42 +2537,42 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2646,18 +2646,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -2998,10 +2998,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3342,28 +3342,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3687,10 +3687,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4014,10 +4014,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4253,19 +4253,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4507,19 +4507,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4687,10 +4687,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4864,26 +4864,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5104,8 +5104,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5326,8 +5326,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -5335,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -5350,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5702,8 +5700,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6048,8 +6046,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -6057,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -6072,16 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6161,10 +6157,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6243,26 +6239,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** rct2: 0x007C73D4 */ static void flying_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6319,25 +6315,25 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { bolliger_mabillard_track_booster( - session, rideIndex, 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6521,8 +6517,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6706,8 +6702,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6891,8 +6887,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7076,10 +7072,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -7182,10 +7178,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -7288,10 +7284,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -7336,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); @@ -7390,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); @@ -7399,26 +7395,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -7729,10 +7725,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8043,28 +8039,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8376,10 +8372,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8691,33 +8687,33 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8745,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) { @@ -8773,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) { @@ -8801,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) { @@ -8863,7 +8859,7 @@ static void flying_rc_track_diag_flat( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8891,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) { @@ -8919,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) { @@ -8947,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) { @@ -9001,15 +8997,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9037,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) { @@ -9065,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) { @@ -9093,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) { @@ -9155,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) { @@ -9183,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) { @@ -9211,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) { @@ -9239,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) { @@ -9293,15 +9289,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9329,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) { @@ -9357,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) { @@ -9385,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) { @@ -9529,15 +9525,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9565,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) { @@ -9593,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) { @@ -9621,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) { @@ -9683,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) { @@ -9711,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) { @@ -9739,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) { @@ -9767,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) { @@ -9821,15 +9817,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9857,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) { @@ -9885,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) { @@ -9913,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) { @@ -10057,15 +10053,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10093,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) { @@ -10121,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) { @@ -10149,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) { @@ -10293,15 +10289,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10329,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) { @@ -10357,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) { @@ -10385,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) { @@ -10447,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) { @@ -10475,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) { @@ -10503,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) { @@ -10531,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) { @@ -10585,15 +10581,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10621,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) { @@ -10649,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) { @@ -10677,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) { @@ -10821,15 +10817,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10857,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) { @@ -10885,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) { @@ -10913,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) { @@ -11057,15 +11053,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11092,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) { @@ -11119,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) { @@ -11146,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) { @@ -11286,15 +11282,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11322,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) { @@ -11350,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) { @@ -11378,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) { @@ -11522,15 +11518,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11558,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) { @@ -11586,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) { @@ -11614,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) { @@ -11758,15 +11754,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11794,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) { @@ -11822,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) { @@ -11850,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) { @@ -11994,10 +11990,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12164,10 +12160,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12334,10 +12330,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12504,10 +12500,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12674,10 +12670,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12843,10 +12839,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13012,10 +13008,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13181,10 +13177,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13350,10 +13346,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13512,10 +13508,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13674,10 +13670,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13843,10 +13839,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -14012,10 +14008,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -14179,10 +14175,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -14346,8 +14342,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14458,8 +14454,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14568,8 +14564,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14680,8 +14676,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14790,8 +14786,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14920,8 +14916,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -15050,10 +15046,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -15108,10 +15104,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -15282,10 +15278,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -15462,30 +15458,30 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -15829,10 +15825,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -16176,30 +16172,30 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16304,10 +16300,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16412,10 +16408,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16520,10 +16516,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16628,46 +16624,44 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { flying_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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { flying_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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16770,10 +16764,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16876,10 +16870,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16982,10 +16976,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -17088,46 +17082,46 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -17232,10 +17226,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -17340,10 +17334,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -17448,10 +17442,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -17556,34 +17550,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, 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 45a1ca2843..e58b2c4d97 100644 --- a/src/openrct2/ride/coaster/GigaCoaster.cpp +++ b/src/openrct2/ride/coaster/GigaCoaster.cpp @@ -41,10 +41,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -117,8 +117,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -151,10 +151,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -247,10 +247,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -317,10 +317,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -413,10 +413,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -491,10 +491,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -569,10 +569,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -665,56 +665,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -877,17 +877,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -924,8 +924,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -962,8 +962,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1000,8 +1000,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1038,8 +1038,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1212,17 +1212,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1266,8 +1266,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1311,8 +1311,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1356,8 +1356,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1401,40 +1401,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1467,16 +1467,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1639,8 +1639,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1803,26 +1803,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1956,8 +1956,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2091,8 +2091,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2194,17 +2194,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2315,17 +2315,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2403,8 +2403,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2489,26 +2489,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2725,8 +2725,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2943,8 +2943,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3313,8 +3313,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3669,8 +3669,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3734,8 +3734,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3771,24 +3771,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** rct2: 0x008ADA34 */ static void giga_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3823,8 +3823,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3864,8 +3864,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3905,8 +3905,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -3947,29 +3947,29 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -4254,8 +4254,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4395,24 +4395,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4577,8 +4577,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4716,8 +4716,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4854,26 +4854,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5014,8 +5014,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5156,31 +5156,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -5320,13 +5320,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -5466,8 +5466,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5542,13 +5542,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -5688,8 +5688,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5764,8 +5764,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5840,13 +5840,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -5986,13 +5986,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -6132,8 +6132,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6208,13 +6208,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -6352,8 +6352,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6428,8 +6428,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6504,13 +6504,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -6650,8 +6650,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6729,8 +6729,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6808,8 +6808,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6887,8 +6887,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6966,8 +6966,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7045,8 +7045,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7124,8 +7124,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7203,8 +7203,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7282,8 +7282,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7359,8 +7359,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7436,8 +7436,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7515,8 +7515,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7594,8 +7594,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7670,8 +7670,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7746,10 +7746,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -7769,8 +7769,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7851,8 +7851,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7940,28 +7940,27 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; giga_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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8130,8 +8129,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8300,28 +8299,27 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; giga_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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8363,8 +8361,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8406,8 +8404,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8449,8 +8447,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8492,44 +8490,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8569,8 +8563,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8610,8 +8604,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8651,8 +8645,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8692,44 +8686,44 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8771,8 +8765,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8814,8 +8808,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8857,8 +8851,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8900,39 +8894,39 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static void giga_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 2164a1ace9..2562cdb072 100644 --- a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp +++ b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp @@ -20,10 +20,10 @@ /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -85,8 +85,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -109,10 +109,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -194,10 +194,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -279,10 +279,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -364,10 +364,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -449,10 +449,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -534,10 +534,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -619,58 +619,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -683,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( @@ -691,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( @@ -699,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( @@ -707,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) @@ -737,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( @@ -752,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( @@ -767,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( @@ -782,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); @@ -797,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( @@ -805,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( @@ -813,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( @@ -821,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); @@ -879,8 +877,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -947,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( @@ -962,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( @@ -977,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( @@ -992,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); @@ -1007,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( @@ -1015,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( @@ -1023,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( @@ -1031,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); @@ -1046,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( @@ -1054,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( @@ -1062,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( @@ -1070,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) @@ -1089,8 +1087,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1103,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( @@ -1111,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( @@ -1119,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( @@ -1127,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); @@ -1143,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( @@ -1151,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( @@ -1159,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( @@ -1167,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); @@ -1182,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( @@ -1190,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( @@ -1198,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( @@ -1206,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); @@ -1221,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( @@ -1229,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( @@ -1237,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( @@ -1245,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); @@ -1260,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( @@ -1268,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( @@ -1276,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( @@ -1284,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); @@ -1299,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( @@ -1307,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( @@ -1315,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( @@ -1323,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); @@ -1335,8 +1333,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1349,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( @@ -1357,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( @@ -1365,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( @@ -1373,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); @@ -1389,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( @@ -1397,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( @@ -1405,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( @@ -1413,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); @@ -1428,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( @@ -1436,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( @@ -1444,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( @@ -1452,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); @@ -1467,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( @@ -1475,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( @@ -1483,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( @@ -1491,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); @@ -1506,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( @@ -1514,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( @@ -1522,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( @@ -1530,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); @@ -1545,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( @@ -1553,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( @@ -1561,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( @@ -1569,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 5b332640ff..2192b3aeff 100644 --- a/src/openrct2/ride/coaster/HybridCoaster.cpp +++ b/src/openrct2/ride/coaster/HybridCoaster.cpp @@ -36,10 +36,10 @@ namespace HybridRC } static void TrackFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, @@ -51,15 +51,15 @@ 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); } static void TrackStation( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, @@ -81,11 +81,10 @@ 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]); - 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, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -93,10 +92,10 @@ namespace HybridRC } static void Track25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, @@ -108,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); @@ -123,8 +121,8 @@ namespace HybridRC } static void Track60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { { 0, 6, height }, @@ -154,7 +152,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); @@ -163,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); @@ -178,10 +175,10 @@ namespace HybridRC } static void TrackFlatTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, @@ -193,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); @@ -208,10 +204,10 @@ namespace HybridRC } static void Track25DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -275,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); @@ -290,10 +285,10 @@ namespace HybridRC } static void Track60DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -358,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); @@ -373,10 +367,10 @@ namespace HybridRC } static void Track25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, @@ -388,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); @@ -403,50 +396,50 @@ namespace HybridRC } static void Track25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track60DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track60DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpTo60DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { { 4, 6, height + 8 }, @@ -454,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, @@ -483,15 +476,15 @@ namespace HybridRC } static void Track90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track90DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegUpTo90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { { 0, 6, height }, @@ -499,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, @@ -519,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); @@ -535,15 +527,15 @@ namespace HybridRC } static void Track90DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track60DegUpTo90DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { { 0, 6, height + 8 }, @@ -551,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, @@ -582,8 +574,8 @@ namespace HybridRC } static void Track60DegDownTo90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -624,8 +616,8 @@ namespace HybridRC } static void TrackLeftQuarterTurn3( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -636,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) @@ -674,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( @@ -707,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) @@ -744,16 +736,16 @@ namespace HybridRC } static void TrackRightQuarterTurn3( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -764,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) @@ -804,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( @@ -839,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( @@ -880,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( @@ -915,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) @@ -952,16 +944,16 @@ namespace HybridRC } static void TrackRightQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftEighthToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -972,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) @@ -1007,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); @@ -1038,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); @@ -1066,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); @@ -1112,8 +1104,8 @@ namespace HybridRC } static void TrackRightEighthToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1124,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) @@ -1159,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); @@ -1190,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); @@ -1218,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); @@ -1264,29 +1256,29 @@ namespace HybridRC } static void TrackLeftEighthToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthToDiag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthToDiag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightEighthToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthToDiag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthToDiag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } static void TrackDiagFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1314,7 +1306,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) { @@ -1322,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; } } @@ -1341,23 +1332,23 @@ 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); paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1382,23 +1373,23 @@ 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); paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1427,13 +1418,13 @@ namespace HybridRC } static void TrackDiag25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1459,7 +1450,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) { @@ -1484,27 +1475,23 @@ 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); paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1529,27 +1516,23 @@ 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); paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1578,13 +1561,13 @@ namespace HybridRC } static void TrackDiag25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1610,7 +1593,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) { @@ -1635,27 +1618,23 @@ 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); paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1680,27 +1659,23 @@ 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); paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1729,13 +1704,13 @@ namespace HybridRC } static void TrackDiagFlatTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1761,7 +1736,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) { @@ -1786,23 +1761,23 @@ 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); paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1827,23 +1802,23 @@ 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); paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1872,13 +1847,13 @@ namespace HybridRC } static void TrackDiag25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1904,7 +1879,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) { @@ -1929,27 +1904,23 @@ 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); paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1974,27 +1945,23 @@ 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); paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2023,13 +1990,13 @@ namespace HybridRC } static void TrackDiagFlatTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2054,7 +2021,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) { @@ -2079,26 +2046,22 @@ 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); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2123,26 +2086,22 @@ 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); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2172,13 +2131,13 @@ namespace HybridRC } static void TrackDiag25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2204,7 +2163,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) { @@ -2229,23 +2188,23 @@ 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); paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2270,23 +2229,23 @@ 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); paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2315,13 +2274,13 @@ namespace HybridRC } static void TrackDiag60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2347,7 +2306,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) { @@ -2372,27 +2331,23 @@ 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); paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2417,27 +2372,23 @@ 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); paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2466,13 +2417,13 @@ namespace HybridRC } static void TrackDiag25DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2498,7 +2449,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) { @@ -2523,27 +2474,23 @@ 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); paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2568,27 +2515,23 @@ 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); paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2617,13 +2560,13 @@ namespace HybridRC } static void TrackDiag60DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2649,7 +2592,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) { @@ -2674,27 +2617,23 @@ 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); paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2719,27 +2658,23 @@ 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); paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2768,13 +2703,13 @@ namespace HybridRC } static void TrackDiag60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2800,7 +2735,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) { @@ -2825,27 +2760,23 @@ 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); paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2870,27 +2801,23 @@ 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); paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2919,13 +2846,13 @@ namespace HybridRC } static void TrackDiag25DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2951,7 +2878,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) { @@ -2976,27 +2903,23 @@ 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); paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3021,27 +2944,23 @@ 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); paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3070,13 +2989,13 @@ namespace HybridRC } static void TrackDiag60DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3102,7 +3021,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) { @@ -3127,27 +3046,23 @@ 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); paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3172,27 +3087,23 @@ 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); paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3221,8 +3132,8 @@ namespace HybridRC } static void TrackFlatToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3253,15 +3164,15 @@ 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); } static void TrackFlatToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3292,29 +3203,29 @@ 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); } static void TrackLeftBankToflat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatToRightBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankToflat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatToLeftBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3345,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); @@ -3360,8 +3270,8 @@ namespace HybridRC } static void TrackRightBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3392,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); @@ -3407,8 +3316,8 @@ namespace HybridRC } static void Track25DegUpToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3439,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); @@ -3454,8 +3362,8 @@ namespace HybridRC } static void Track25DegUpToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3486,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); @@ -3501,36 +3408,36 @@ namespace HybridRC } static void TrackLeftBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpToRightBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpToLeftBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBankTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBankTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftbank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3561,22 +3468,22 @@ 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); } static void TrackRightbank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftbank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftbank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackDiagFlatToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3607,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); @@ -3634,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); @@ -3665,8 +3572,8 @@ namespace HybridRC } static void TrackDiagFlatToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3694,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); @@ -3724,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); @@ -3755,8 +3662,8 @@ namespace HybridRC } static void TrackDiagLeftBankToflat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3787,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); @@ -3814,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); @@ -3845,8 +3752,8 @@ namespace HybridRC } static void TrackDiagRightBankToflat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3874,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); @@ -3904,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); @@ -3935,8 +3842,8 @@ namespace HybridRC } static void TrackDiagLeftBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3967,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); @@ -3994,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); @@ -4025,8 +3932,8 @@ namespace HybridRC } static void TrackDiagRightBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4054,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); @@ -4084,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); @@ -4115,8 +4022,8 @@ namespace HybridRC } static void TrackDiag25DegUpToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4147,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); @@ -4178,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); @@ -4213,8 +4112,8 @@ namespace HybridRC } static void TrackDiag25DegUpToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4242,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); @@ -4276,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); @@ -4311,8 +4202,8 @@ namespace HybridRC } static void TrackDiagLeftBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4342,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); @@ -4372,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); @@ -4407,8 +4290,8 @@ namespace HybridRC } static void TrackDiagRightBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4435,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); @@ -4468,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); @@ -4503,8 +4378,8 @@ namespace HybridRC } static void TrackDiag25DegDownToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4535,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); @@ -4562,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); @@ -4593,8 +4468,8 @@ namespace HybridRC } static void TrackDiag25DegDownToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4622,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); @@ -4652,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); @@ -4683,8 +4558,8 @@ namespace HybridRC } static void TrackDiagLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4715,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); @@ -4742,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); @@ -4773,8 +4648,8 @@ namespace HybridRC } static void TrackDiagRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4802,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); @@ -4832,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); @@ -4863,8 +4738,8 @@ namespace HybridRC } static void TrackLeftQuarterTurn3Bank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4878,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( @@ -4887,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) @@ -4919,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( @@ -4952,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( @@ -4961,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( @@ -4970,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) @@ -4995,16 +4870,16 @@ namespace HybridRC } static void TrackRightQuarterTurn3Bank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackBankedLeftQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5018,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( @@ -5027,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) @@ -5061,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( @@ -5096,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( @@ -5105,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( @@ -5140,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( @@ -5175,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( @@ -5184,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( @@ -5193,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) @@ -5218,16 +5093,16 @@ namespace HybridRC } static void TrackBankedRightQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackBankedLeftQuarterTurn5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackBankedLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftEighthBankToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5241,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( @@ -5250,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) @@ -5279,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( @@ -5288,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); @@ -5313,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); @@ -5341,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); @@ -5390,8 +5265,8 @@ namespace HybridRC } static void TrackRightEighthBankToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5402,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( @@ -5417,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( @@ -5426,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) @@ -5443,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( @@ -5458,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); @@ -5477,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); @@ -5505,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); @@ -5555,24 +5430,24 @@ namespace HybridRC } static void TrackLeftEighthBankToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthBankToDiag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthBankToDiag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightEighthBankToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthBankToDiag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthBankToDiag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } static void TrackLeftQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5583,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) @@ -5618,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( @@ -5642,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) @@ -5679,8 +5554,8 @@ namespace HybridRC } static void TrackRightQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5691,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) @@ -5726,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( @@ -5750,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) @@ -5787,24 +5662,24 @@ namespace HybridRC } static void TrackLeftQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn5Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5815,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) @@ -5855,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( @@ -5890,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( @@ -5931,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( @@ -5966,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) @@ -6003,8 +5878,8 @@ namespace HybridRC } static void TrackRightQuarterTurn5Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6015,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) @@ -6055,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( @@ -6090,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( @@ -6131,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( @@ -6166,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) @@ -6203,24 +6078,24 @@ namespace HybridRC } static void TrackLeftQuarterTurn5Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightQuarterTurn5Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn5Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn5Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn1Tile60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6231,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( @@ -6240,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( @@ -6249,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( @@ -6258,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); @@ -6267,8 +6142,8 @@ namespace HybridRC } static void TrackRightQuarterTurn1Tile60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6279,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( @@ -6288,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( @@ -6297,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( @@ -6306,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( @@ -6316,22 +6191,22 @@ namespace HybridRC } static void TrackLeftQuarterTurn1Tile60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightQuarterTurn1Tile60DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn1Tile60DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn1Tile60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftQuarterTurn1Tile60DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn1Tile60DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn1Tile90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6375,8 +6250,8 @@ namespace HybridRC } static void TrackRightQuarterTurn1Tile90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6420,22 +6295,22 @@ namespace HybridRC } static void TrackLeftQuarterTurn1Tile90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightQuarterTurn1Tile90DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn1Tile90DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn1Tile90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftQuarterTurn1Tile90DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn1Tile90DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void Track25DegUpToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6463,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); @@ -6478,8 +6352,8 @@ namespace HybridRC } static void Track25DegUpToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6507,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); @@ -6522,8 +6395,8 @@ namespace HybridRC } static void TrackLeftBanked25DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6551,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); @@ -6566,8 +6438,8 @@ namespace HybridRC } static void TrackRightBanked25DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6595,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); @@ -6610,36 +6481,36 @@ namespace HybridRC } static void TrackLeftBanked25DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBanked25DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBanked25DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedFlatToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6670,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); @@ -6685,8 +6555,8 @@ namespace HybridRC } static void TrackRightBankedFlatToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6717,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); @@ -6732,8 +6601,8 @@ namespace HybridRC } static void TrackLeftBanked25DegUpToLeftBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6764,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); @@ -6779,8 +6647,8 @@ namespace HybridRC } static void TrackRightBanked25DegUpToRightBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6811,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); @@ -6826,36 +6693,36 @@ namespace HybridRC } static void TrackLeftBankedFlatToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBanked25DegUpToRightBankedFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToRightBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankedFlatToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBanked25DegUpToLeftBankedFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToLeftBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToLeftBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBankedFlatToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankedFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToRightBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBankedFlatToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankedFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegUpLeftBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6880,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); @@ -6895,8 +6761,8 @@ namespace HybridRC } static void Track25DegUpRightBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6921,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); @@ -6936,22 +6801,22 @@ namespace HybridRC } static void Track25DegDownLeftBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpRightBanked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpRightBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownRightBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpLeftBanked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpLeftBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6979,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); @@ -6994,8 +6858,8 @@ namespace HybridRC } static void TrackFlatToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7023,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); @@ -7038,8 +6901,8 @@ namespace HybridRC } static void TrackLeftBanked25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7067,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); @@ -7082,8 +6944,8 @@ namespace HybridRC } static void TrackRightBanked25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7111,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); @@ -7126,36 +6987,36 @@ namespace HybridRC } static void TrackFlatToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBanked25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBanked25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7166,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( @@ -7175,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) @@ -7204,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( @@ -7228,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( @@ -7237,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( @@ -7246,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) @@ -7271,8 +7132,8 @@ namespace HybridRC } static void TrackRightBankedQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7283,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( @@ -7298,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) @@ -7321,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( @@ -7345,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( @@ -7354,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( @@ -7363,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) @@ -7388,24 +7249,24 @@ namespace HybridRC } static void TrackLeftBankedQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightBankedQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightBankedQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftBankedQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftBankedQuarterTurn5Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7416,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( @@ -7425,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) @@ -7459,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( @@ -7468,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( @@ -7497,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( @@ -7506,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( @@ -7541,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( @@ -7550,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( @@ -7579,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( @@ -7588,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( @@ -7597,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) @@ -7622,8 +7483,8 @@ namespace HybridRC } static void TrackRightBankedQuarterTurn5Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7634,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( @@ -7649,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) @@ -7677,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( @@ -7692,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( @@ -7715,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( @@ -7730,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( @@ -7759,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( @@ -7774,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( @@ -7797,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( @@ -7806,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( @@ -7815,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) @@ -7840,24 +7701,24 @@ namespace HybridRC } static void TrackLeftBankedQuarterTurn5Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightBankedQuarterTurn5Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightBankedQuarterTurn5Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftBankedQuarterTurn5Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackSBendLeft( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7868,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) @@ -7903,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( @@ -7938,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( @@ -7973,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) @@ -8010,8 +7871,8 @@ namespace HybridRC } static void TrackSBendRight( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8022,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) @@ -8057,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( @@ -8092,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( @@ -8127,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) @@ -8164,8 +8025,8 @@ namespace HybridRC } static void TrackLeftHalfBankedHelixUpSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8179,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( @@ -8188,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) @@ -8214,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); @@ -8235,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( @@ -8268,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( @@ -8277,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( @@ -8286,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) @@ -8314,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( @@ -8323,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( @@ -8332,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) @@ -8357,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); @@ -8378,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( @@ -8411,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( @@ -8426,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( @@ -8435,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) @@ -8449,8 +8310,8 @@ namespace HybridRC } static void TrackRightHalfBankedHelixUpSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8461,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( @@ -8476,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( @@ -8485,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) @@ -8499,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); @@ -8520,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( @@ -8553,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( @@ -8562,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( @@ -8571,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) @@ -8599,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( @@ -8608,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( @@ -8617,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) @@ -8642,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); @@ -8663,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( @@ -8699,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( @@ -8708,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) @@ -8734,8 +8595,8 @@ namespace HybridRC } static void TrackLeftHalfBankedHelixDownSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -8743,12 +8604,12 @@ 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, trackElement); } static void TrackRightHalfBankedHelixDownSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -8756,12 +8617,12 @@ 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, trackElement); } static void TrackLeftHalfBankedHelixUpLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8775,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( @@ -8784,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) @@ -8818,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( @@ -8853,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( @@ -8862,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( @@ -8897,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( @@ -8932,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( @@ -8941,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( @@ -8950,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) @@ -8978,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( @@ -8987,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( @@ -8996,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) @@ -9029,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( @@ -9064,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( @@ -9079,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( @@ -9108,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( @@ -9143,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( @@ -9158,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( @@ -9167,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) @@ -9181,8 +9042,8 @@ namespace HybridRC } static void TrackRightHalfBankedHelixUpLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9193,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( @@ -9208,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( @@ -9217,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) @@ -9239,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( @@ -9274,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( @@ -9289,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( @@ -9318,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( @@ -9353,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( @@ -9362,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( @@ -9371,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) @@ -9399,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( @@ -9408,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( @@ -9417,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) @@ -9450,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( @@ -9485,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( @@ -9494,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( @@ -9529,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( @@ -9567,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( @@ -9576,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) @@ -9602,8 +9463,8 @@ namespace HybridRC } static void TrackLeftHalfBankedHelixDownLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -9611,12 +9472,12 @@ 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, trackElement); } static void TrackRightHalfBankedHelixDownLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -9624,12 +9485,12 @@ 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, trackElement); } static void TrackLeftBarrelRollUpToDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9669,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); @@ -9714,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; @@ -9764,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; @@ -9773,8 +9631,8 @@ namespace HybridRC } static void TrackRightBarrelRollUpToDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9814,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); @@ -9859,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; @@ -9900,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: @@ -9918,22 +9773,22 @@ namespace HybridRC } static void TrackLeftBarrelRollDownToUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBarrelRollUpToDown(session, rideIndex, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBarrelRollDownToUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBarrelRollUpToDown(session, rideIndex, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegToInvertedFlatQuarterLoopUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10012,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; @@ -10053,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); @@ -10066,43 +9919,43 @@ namespace HybridRC } static void TrackInvertedFlatTo90DegQuarterLoopDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track90DegToInvertedFlatQuarterLoopUp(session, rideIndex, 2 - trackSequence, direction, height, tileElement); + Track90DegToInvertedFlatQuarterLoopUp(session, ride, 2 - trackSequence, direction, height, trackElement); } static void Trackbrakes( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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); } static void TrackOnRidePhoto( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); - 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, trackElement); + 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); } static void TrackFlatTo60DegUpLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10131,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); @@ -10164,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; @@ -10193,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; @@ -10222,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: @@ -10239,8 +10092,8 @@ namespace HybridRC } static void Track60DegUpToFlatLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10269,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); @@ -10302,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; @@ -10331,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; @@ -10360,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: @@ -10377,54 +10230,53 @@ namespace HybridRC } static void TrackFlatTo60DegDownLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track60DegUpToFlatLongBase(session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpToFlatLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownToFlatLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatTo60DegUpLongBase(session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo60DegUpLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackBlockBrakes( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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); } static void Trackbooster( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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); } static void Trackpowered_lift( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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); @@ -10438,8 +10290,8 @@ namespace HybridRC } static void TrackLeftBankToLeftQuarterTurn3Tile25DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10450,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( @@ -10459,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) @@ -10488,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( @@ -10512,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) @@ -10549,8 +10401,8 @@ namespace HybridRC } static void TrackRightBankToRightQuarterTurn3Tile25DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10561,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( @@ -10576,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) @@ -10599,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( @@ -10623,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) @@ -10660,8 +10512,8 @@ namespace HybridRC } static void TrackLeftQuarterTurn3Tile25DegDownToLeftBank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10672,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) @@ -10707,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( @@ -10731,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( @@ -10740,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) @@ -10771,8 +10623,8 @@ namespace HybridRC } static void TrackRightQuarterTurn3Tile25DegDownToRightBank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10783,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) @@ -10818,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( @@ -10842,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( @@ -10857,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/InvertedHairpinCoaster.cpp b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp index 3890fb9aa5..3dbe6231db 100644 --- a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp @@ -20,10 +20,10 @@ /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -82,8 +82,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -109,10 +109,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -203,10 +203,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -273,10 +273,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -367,10 +367,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -449,10 +449,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -555,10 +555,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -649,58 +649,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -819,17 +817,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -915,8 +913,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1002,28 +1000,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1072,18 +1070,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1162,10 +1160,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1265,24 +1263,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1314,8 +1312,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { diff --git a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp index 0b92ceea7c..73ca2071de 100644 --- a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp @@ -20,8 +20,8 @@ /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -53,8 +53,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -80,8 +80,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -145,8 +145,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -186,8 +186,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -248,8 +248,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -295,8 +295,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -342,8 +342,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -404,58 +404,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -495,16 +493,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -548,17 +546,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -599,8 +596,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -643,8 +640,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -693,8 +690,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, 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 e1fc2654d1..dd726c7b9f 100644 --- a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp @@ -20,10 +20,10 @@ /** rct2: 0x008A92E8 */ static void inverted_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -73,8 +73,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -100,10 +100,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -194,8 +194,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -235,10 +235,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -329,8 +329,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -376,8 +376,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -447,10 +447,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -541,56 +541,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -769,17 +769,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -820,8 +820,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -862,8 +862,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -904,8 +904,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -946,8 +946,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1126,17 +1126,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1202,8 +1202,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1269,8 +1269,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1336,8 +1336,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1403,40 +1403,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1477,16 +1477,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1650,8 +1650,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1815,28 +1815,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2006,8 +2004,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2177,8 +2175,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2484,8 +2482,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2791,8 +2789,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2910,17 +2908,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3039,17 +3037,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3135,8 +3133,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3222,28 +3220,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3351,8 +3347,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3460,8 +3456,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3569,8 +3565,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3678,8 +3674,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3831,16 +3827,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3957,8 +3953,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4075,24 +4071,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4128,8 +4124,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4166,26 +4162,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** rct2: 0x008A96A8 */ static void inverted_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4216,8 +4210,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4401,8 +4395,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4586,8 +4580,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4771,8 +4765,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4956,8 +4950,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -5021,8 +5015,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -5086,8 +5080,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -5124,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); @@ -5132,24 +5126,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5311,8 +5305,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5474,26 +5468,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5655,8 +5649,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5818,31 +5812,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5869,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) { @@ -5896,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) { @@ -5923,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) { @@ -5975,13 +5969,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6008,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) { @@ -6035,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) { @@ -6062,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) { @@ -6114,8 +6108,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6197,13 +6191,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6230,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) { @@ -6257,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) { @@ -6284,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) { @@ -6336,8 +6330,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6419,8 +6413,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6502,13 +6496,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6535,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) { @@ -6562,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) { @@ -6589,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) { @@ -6641,13 +6635,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6674,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) { @@ -6701,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) { @@ -6728,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) { @@ -6780,8 +6774,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6863,13 +6857,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6895,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) { @@ -6921,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) { @@ -6947,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) { @@ -6999,8 +6993,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7082,8 +7076,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7165,13 +7159,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7198,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) { @@ -7225,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) { @@ -7252,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) { @@ -7304,8 +7298,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7388,8 +7382,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7472,8 +7466,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7556,8 +7550,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7640,8 +7634,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7723,8 +7717,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7806,8 +7800,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7889,8 +7883,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7972,8 +7966,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8052,8 +8046,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8132,8 +8126,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8215,8 +8209,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8298,8 +8292,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8382,8 +8376,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8466,8 +8460,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8695,8 +8689,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8924,24 +8918,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8972,8 +8966,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9059,8 +9053,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9146,28 +9140,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9331,8 +9325,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9496,28 +9490,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -9581,8 +9575,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -9646,8 +9640,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -9711,8 +9705,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -9776,44 +9770,44 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -9877,8 +9871,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -9942,8 +9936,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -10007,8 +10001,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -10072,44 +10066,44 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -10173,8 +10167,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -10238,8 +10232,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -10303,8 +10297,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, 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 c78eed4ea0..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,11 +1842,10 @@ 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + 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); @@ -1640,12 +1864,12 @@ 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, - const TileElement* tileElement, uint8_t rideType) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, uint16_t height, + 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 +1878,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 +1900,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,15 +1915,15 @@ 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, trackElement); 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + 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); @@ -1720,8 +1944,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t imageId = junior_rc_track_pieces_flat_to_25_deg_up[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK]; @@ -1749,8 +1973,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t imageId = junior_rc_track_pieces_25_deg_up_to_flat[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK]; @@ -1797,8 +2021,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_5_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -1873,24 +2097,25 @@ 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + junior_rc_right_quarter_turn_5_tiles_paint_setup(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** * 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t image_id; @@ -1937,8 +2162,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t image_id; @@ -1982,17 +2207,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static constexpr const CoordsXY junior_rc_banked_right_quarter_turn_5_tiles_bound_lengths[4][5] = { @@ -2059,8 +2284,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint8_t thickness = 1; if (direction == 2 && (trackSequence == 0 || trackSequence == 6)) @@ -2153,20 +2378,20 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** * 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t image_id; @@ -2225,8 +2450,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t image_id; @@ -2285,8 +2510,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t image_id; @@ -2346,8 +2571,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t image_id; @@ -2407,40 +2632,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** * 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** * 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** * 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static constexpr const CoordsXYZ junior_rc_left_bank_bound_lengths[4] = { @@ -2461,16 +2686,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t image_id; 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], + { junior_rc_left_bank_bound_offsets[direction], height }); if (direction & 1) { @@ -2496,22 +2720,22 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_right_quarter_turn_5_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], 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: @@ -2583,15 +2807,15 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_right_quarter_turn_5_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], 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: @@ -2664,64 +2888,64 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, - tileElement); + session, ride, junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 1) & 3, height, + trackElement); } /* 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, - tileElement); + session, ride, junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction - 1) & 3, height, + trackElement); } /* 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { 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 }, @@ -2733,13 +2957,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) @@ -2812,22 +3034,22 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { 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 }, @@ -2839,13 +3061,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) @@ -2918,8 +3138,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_3_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -2927,7 +3147,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: @@ -2957,12 +3180,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } static constexpr const CoordsXY junior_rc_right_quarter_turn_3_tiles_bank_bound_lengths[4][3] = { @@ -3013,10 +3235,15 @@ 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, - const TileElement* tileElement) + 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], @@ -3035,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: @@ -3064,8 +3294,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t imageId = 0; CoordsXY offset; @@ -3090,9 +3320,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), boundsLength.x, boundsLength.y, 1, - height, boundsOffset.x, boundsOffset.y, height); + { + PaintAddImageAsParent(session, imageId, { offset, height }, { boundsLength, 1 }, { boundsOffset, height }); + } if (direction == 0 && trackSequence == 0) { @@ -3114,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: @@ -3143,8 +3376,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t imageId = 0; CoordsXY offset; @@ -3169,9 +3402,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), boundsLength.x, boundsLength.y, 1, - height, boundsOffset.x, boundsOffset.y, height); + session, imageId, { offset, height }, { boundsLength.x, boundsLength.y, 1 }, { boundsOffset, height }); + } if (direction == 0 && trackSequence == 0) { @@ -3193,7 +3427,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: @@ -3223,64 +3460,69 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + 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) { @@ -3345,10 +3587,10 @@ 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, - const TileElement* tileElement) + 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) { @@ -3413,8 +3655,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence > 3) { @@ -3424,13 +3666,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence > 3) { @@ -3440,15 +3682,15 @@ 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, trackElement); } /** 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, - const TileElement* tileElement) + 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) { @@ -3531,10 +3773,10 @@ 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, - const TileElement* tileElement) + 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) { @@ -3617,8 +3859,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence > 6) { @@ -3628,13 +3870,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence > 6) { @@ -3644,15 +3886,15 @@ 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, trackElement); } /** * 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t image_id; @@ -3685,12 +3927,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) @@ -3719,8 +3961,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( session, defaultEighthToDiagThickness, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -3785,8 +4027,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( session, defaultEighthToDiagThickness, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -3851,22 +4093,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, - const TileElement* tileElement) + 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 }; 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, trackElement); } /** 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, - const TileElement* tileElement) + 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 }; 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, trackElement); } static constexpr const CoordsXY junior_rc_left_eighth_to_diag_bank_bound_lengths[4][4] = { @@ -3952,8 +4194,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( session, junior_rc_left_eighth_to_diag_bank_thickness, height, direction, trackSequence, @@ -4099,8 +4341,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( session, junior_rc_right_eighth_to_diag_bank_thickness, height, direction, trackSequence, @@ -4165,35 +4407,41 @@ 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, - const TileElement* tileElement) + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + 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, rideIndex, 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, - 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4212,8 +4460,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4232,8 +4480,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4253,8 +4501,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + 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); @@ -4277,8 +4525,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4298,8 +4546,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + 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); @@ -4322,8 +4570,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4343,8 +4591,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4364,8 +4612,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + 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); @@ -4388,8 +4636,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4409,8 +4657,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + 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); @@ -4434,125 +4682,125 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_60_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_60_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4578,8 +4826,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4605,8 +4853,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4632,8 +4880,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4659,8 +4907,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4686,8 +4934,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4713,8 +4961,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4740,8 +4988,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4767,8 +5015,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4794,8 +5042,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4821,8 +5069,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4848,8 +5096,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4889,8 +5137,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint8_t thickness = direction == 0 ? 0 : 1; track_paint_util_diag_tiles_paint( @@ -4912,8 +5160,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint8_t thickness = direction == 2 ? 0 : 1; track_paint_util_diag_tiles_paint( @@ -4947,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 }, @@ -4957,18 +5210,17 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; 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, { 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) { @@ -4986,7 +5238,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( @@ -5000,20 +5252,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static constexpr const CoordsXY junior_rc_25_deg_up_to_60_deg_up_bound_lengths[4][2] = { @@ -5023,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 } }, @@ -5033,21 +5290,18 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; 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, { 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], height }); if (junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5056,13 +5310,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), - 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, { 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], height }); } switch (direction) @@ -5081,7 +5332,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( @@ -5095,38 +5346,35 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_25_deg_up_to_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; 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, { 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], height }); if (junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5135,13 +5383,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), - 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, { 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], height }); } switch (direction) @@ -5173,25 +5418,25 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_60_deg_up_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -5210,8 +5455,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -5231,8 +5476,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -5252,8 +5497,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { if (direction == 1 && trackSequence == 3) { @@ -5261,7 +5506,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 { @@ -5284,8 +5529,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { if (direction == 3 && trackSequence == 0) { @@ -5293,7 +5538,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 { @@ -5316,8 +5561,8 @@ 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, - const TileElement* tileElement, JuniorRcChainType chainType) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -5337,62 +5582,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } @@ -5403,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 } }, @@ -5427,22 +5677,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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]; 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, { 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) { @@ -5451,12 +5698,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), - 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, { 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) @@ -5475,7 +5719,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( @@ -5489,29 +5733,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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]; 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, { 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) { @@ -5520,12 +5761,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), - 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, { 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) @@ -5557,103 +5795,103 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /* 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - junior_rc_paint_station(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_flat_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /* 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /* 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static void junior_rc_booster_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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); } @@ -5670,8 +5908,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = junior_rc_track_pieces_flat[0][direction] | session->TrackColours[SCHEME_TRACK]; constexpr const int8_t photoCameraOffset = -1; @@ -5715,7 +5953,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 76536e5a88..be1220034e 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.h +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.h @@ -7,11 +7,9 @@ * 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" -#include "../../paint/tile_element/Paint.TileElement.h" enum class JuniorRcChainType : uint8_t { @@ -20,96 +18,98 @@ enum class JuniorRcChainType : uint8_t ChainLift, }; +struct Ride; +struct paint_session; +struct TrackElement; + void junior_rc_paint_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, uint8_t rideType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, 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, - const TileElement* tileElement, JuniorRcChainType chainType); - -#endif // _JUNIOR_ROLLER_COASTER_H + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + const TrackElement& trackElement, JuniorRcChainType chainType); diff --git a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp index 2c44019139..ff10ded6d7 100644 --- a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp @@ -20,12 +20,12 @@ /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -132,10 +132,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, rideIndex, 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); @@ -190,12 +190,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -355,12 +355,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -471,12 +471,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -636,12 +636,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -766,12 +766,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -920,12 +920,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1085,58 +1085,58 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -1502,19 +1502,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1592,10 +1592,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1673,10 +1673,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1754,10 +1754,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1835,10 +1835,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -2205,19 +2205,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2326,10 +2326,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2438,10 +2438,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2550,10 +2550,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2662,42 +2662,42 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2771,18 +2771,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3123,10 +3123,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3467,30 +3467,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3814,10 +3812,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4141,8 +4139,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4420,8 +4418,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4655,10 +4653,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4894,19 +4892,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5148,19 +5146,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5328,10 +5326,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5505,28 +5503,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5747,8 +5743,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5969,8 +5965,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -5978,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -5993,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6345,8 +6339,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6691,8 +6685,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -6700,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -6715,16 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6799,10 +6791,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6878,28 +6870,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6957,10 +6947,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -7005,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); @@ -7059,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); @@ -7068,10 +7058,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -7382,10 +7372,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -7696,28 +7686,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8029,10 +8019,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8344,33 +8334,33 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8398,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) { @@ -8426,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) { @@ -8454,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) { @@ -8516,7 +8506,7 @@ static void lay_down_rc_track_diag_flat( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8544,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) { @@ -8572,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) { @@ -8600,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) { @@ -8654,15 +8644,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8690,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) { @@ -8718,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) { @@ -8746,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) { @@ -8808,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) { @@ -8836,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) { @@ -8864,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) { @@ -8892,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) { @@ -8946,15 +8936,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8982,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) { @@ -9010,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) { @@ -9038,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) { @@ -9182,15 +9172,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9218,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) { @@ -9246,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) { @@ -9274,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) { @@ -9336,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) { @@ -9364,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) { @@ -9392,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) { @@ -9420,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) { @@ -9474,15 +9464,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9510,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) { @@ -9538,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) { @@ -9566,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) { @@ -9710,15 +9700,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9746,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) { @@ -9774,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) { @@ -9802,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) { @@ -9946,15 +9936,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9982,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) { @@ -10010,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) { @@ -10038,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) { @@ -10100,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) { @@ -10128,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) { @@ -10156,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) { @@ -10184,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) { @@ -10238,15 +10228,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10274,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) { @@ -10302,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) { @@ -10330,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) { @@ -10474,15 +10464,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10510,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) { @@ -10538,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) { @@ -10566,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) { @@ -10710,15 +10700,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10745,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) { @@ -10772,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) { @@ -10799,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) { @@ -10939,15 +10929,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10975,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) { @@ -11003,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) { @@ -11031,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) { @@ -11175,15 +11165,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11211,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) { @@ -11239,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) { @@ -11267,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) { @@ -11411,15 +11401,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11447,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) { @@ -11475,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) { @@ -11503,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) { @@ -11647,10 +11637,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11817,10 +11807,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11987,10 +11977,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12157,10 +12147,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12327,10 +12317,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12496,10 +12486,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12665,10 +12655,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12834,10 +12824,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13003,10 +12993,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13165,10 +13155,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13327,10 +13317,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13496,10 +13486,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13665,10 +13655,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13832,10 +13822,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13999,8 +13989,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14111,8 +14101,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14221,8 +14211,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14333,8 +14323,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14443,8 +14433,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14573,8 +14563,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14703,8 +14693,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14830,8 +14820,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -14944,8 +14934,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -15058,18 +15048,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -15123,8 +15113,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -15307,8 +15297,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -15491,8 +15481,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -15675,8 +15665,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { diff --git a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp index 9eaf612ef5..dd12054889 100644 --- a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp @@ -32,8 +32,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -66,8 +66,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -329,8 +329,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -546,8 +546,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -683,8 +683,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -820,8 +820,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -957,8 +957,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1094,8 +1094,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1206,8 +1206,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1319,24 +1319,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1363,8 +1363,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1404,16 +1404,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1455,16 +1455,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1501,8 +1501,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1545,8 +1545,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1643,19 +1643,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -1671,8 +1671,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1718,8 +1718,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1765,20 +1765,20 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { lim_launched_rc_track_left_quarter_turn_1_90_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + 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 dfebe07764..a869a5f50f 100644 --- a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp @@ -18,15 +18,18 @@ #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; /** rct2: 0x008A6370 */ static void looping_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -79,18 +82,22 @@ 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, - const TileElement* tileElement) + 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] = { + { 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 }, + { 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 : imageIdsWithoutCsg; PaintAddImageAsParentRotated( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, @@ -98,7 +105,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, 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); @@ -106,10 +113,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -176,10 +183,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -246,10 +253,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -316,10 +323,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -394,10 +401,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -472,10 +479,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -542,56 +549,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -754,17 +761,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -801,8 +808,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -839,8 +846,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -877,8 +884,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -915,8 +922,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1089,17 +1096,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1143,8 +1150,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1188,8 +1195,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1233,8 +1240,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1278,40 +1285,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1344,16 +1351,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1516,8 +1523,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1680,27 +1687,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1834,8 +1840,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1969,8 +1975,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2256,8 +2262,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2511,8 +2517,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2614,17 +2620,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2735,17 +2741,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2823,8 +2829,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2909,27 +2915,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3146,8 +3151,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3364,8 +3369,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3373,14 +3378,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3388,14 +3392,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3736,8 +3739,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4078,8 +4081,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4087,14 +4090,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4102,14 +4104,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4145,8 +4146,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4182,25 +4183,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** rct2: 0x008A6770 */ static void looping_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4231,8 +4231,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4272,8 +4272,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4313,8 +4313,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4351,7 +4351,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); @@ -4359,24 +4359,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4514,8 +4514,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4652,26 +4652,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4812,8 +4812,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4954,31 +4954,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5005,7 +5005,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) { @@ -5032,7 +5032,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) { @@ -5059,7 +5059,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) { @@ -5118,13 +5118,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5151,7 +5151,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) { @@ -5178,7 +5178,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) { @@ -5205,7 +5205,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) { @@ -5264,13 +5264,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5297,7 +5297,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) { @@ -5324,7 +5324,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) { @@ -5351,7 +5351,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) { @@ -5410,13 +5410,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5443,7 +5443,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) { @@ -5470,7 +5470,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) { @@ -5497,7 +5497,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) { @@ -5556,13 +5556,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5589,7 +5589,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) { @@ -5616,7 +5616,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) { @@ -5643,7 +5643,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) { @@ -5702,13 +5702,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5735,7 +5735,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) { @@ -5762,7 +5762,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) { @@ -5789,7 +5789,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) { @@ -5848,13 +5848,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5881,7 +5881,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) { @@ -5908,7 +5908,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) { @@ -5935,7 +5935,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) { @@ -5994,13 +5994,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6027,7 +6027,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) { @@ -6054,7 +6054,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) { @@ -6081,7 +6081,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) { @@ -6140,13 +6140,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6173,7 +6173,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) { @@ -6200,7 +6200,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) { @@ -6227,7 +6227,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) { @@ -6286,13 +6286,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6318,7 +6318,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) { @@ -6344,7 +6344,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) { @@ -6370,7 +6370,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) { @@ -6430,13 +6430,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6463,7 +6463,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) { @@ -6490,7 +6490,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) { @@ -6517,7 +6517,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) { @@ -6576,13 +6576,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6609,7 +6609,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) { @@ -6636,7 +6636,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) { @@ -6663,7 +6663,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) { @@ -6722,13 +6722,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6755,7 +6755,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) { @@ -6782,7 +6782,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) { @@ -6809,7 +6809,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) { @@ -6868,8 +6868,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6947,8 +6947,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7026,8 +7026,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7105,8 +7105,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7184,8 +7184,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7263,8 +7263,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7342,8 +7342,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7421,8 +7421,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7500,8 +7500,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7577,8 +7577,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7654,8 +7654,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7733,8 +7733,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7812,8 +7812,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7888,8 +7888,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7964,8 +7964,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7996,8 +7996,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8078,8 +8078,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8167,28 +8167,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8357,8 +8357,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8527,28 +8527,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8590,8 +8590,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8633,8 +8633,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8676,8 +8676,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8719,44 +8719,44 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { looping_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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { looping_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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8796,8 +8796,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8837,8 +8837,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8878,8 +8878,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8919,44 +8919,44 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8998,8 +8998,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -9041,8 +9041,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -9084,8 +9084,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -9127,45 +9127,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static void looping_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (!is_csg_loaded()) { - looping_rc_track_brakes(session, rideIndex, trackSequence, direction, height, tileElement); + looping_rc_track_brakes(session, ride, trackSequence, direction, height, trackElement); return; } @@ -9174,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)) diff --git a/src/openrct2/ride/coaster/MineRide.cpp b/src/openrct2/ride/coaster/MineRide.cpp index a86f9c5226..8bcb786a83 100644 --- a/src/openrct2/ride/coaster/MineRide.cpp +++ b/src/openrct2/ride/coaster/MineRide.cpp @@ -20,8 +20,8 @@ /** rct2: 0x008B08D0 */ static void mine_ride_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -53,8 +53,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -77,8 +77,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -134,8 +134,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -191,8 +191,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -248,32 +248,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -450,17 +450,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -513,8 +513,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -567,8 +567,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -621,8 +621,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -675,8 +675,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -863,17 +863,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -933,8 +933,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -994,8 +994,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1055,8 +1055,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1116,40 +1116,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1198,16 +1198,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1355,8 +1355,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1504,8 +1504,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1621,17 +1621,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1756,17 +1756,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2011,8 +2011,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2257,8 +2257,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -2266,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -2281,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2657,8 +2655,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3027,8 +3025,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3036,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3051,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3095,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); @@ -3103,8 +3099,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3249,8 +3245,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3394,26 +3390,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3561,8 +3557,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3710,26 +3706,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3804,8 +3800,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3880,8 +3876,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3956,8 +3952,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4032,8 +4028,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4108,8 +4104,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4182,8 +4178,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4258,8 +4254,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4337,8 +4333,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4416,8 +4412,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4495,8 +4491,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4574,8 +4570,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4653,8 +4649,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4732,8 +4728,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4811,8 +4807,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4890,8 +4886,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4967,8 +4963,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5044,8 +5040,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5123,8 +5119,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5202,8 +5198,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5278,8 +5274,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { diff --git a/src/openrct2/ride/coaster/MineTrainCoaster.cpp b/src/openrct2/ride/coaster/MineTrainCoaster.cpp index 698824fda3..7b1539b5e5 100644 --- a/src/openrct2/ride/coaster/MineTrainCoaster.cpp +++ b/src/openrct2/ride/coaster/MineTrainCoaster.cpp @@ -32,32 +32,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { 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; } } @@ -86,8 +86,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -121,32 +121,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { 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; } } @@ -190,30 +190,30 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { 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) @@ -230,32 +230,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { 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; } } @@ -299,34 +299,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { 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) @@ -343,34 +343,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { 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) @@ -387,32 +387,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { 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; } } @@ -456,56 +456,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -692,17 +692,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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); @@ -738,34 +738,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { 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); @@ -775,8 +775,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -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); @@ -812,34 +812,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { 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); @@ -849,8 +849,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -1047,17 +1047,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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) @@ -1100,34 +1100,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { 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) @@ -1144,8 +1144,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -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) @@ -1188,34 +1188,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { 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) @@ -1232,62 +1232,62 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { 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); @@ -1297,16 +1297,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -1493,8 +1493,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -1681,28 +1681,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1712,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) @@ -1743,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( @@ -1774,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( @@ -1805,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) @@ -1840,8 +1838,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1851,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) @@ -1882,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( @@ -1913,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( @@ -1944,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) @@ -1979,8 +1977,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1990,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) @@ -2019,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); @@ -2066,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) @@ -2101,17 +2099,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2124,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) @@ -2154,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); @@ -2202,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( @@ -2216,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) @@ -2241,17 +2239,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2261,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) @@ -2290,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); @@ -2315,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) @@ -2350,8 +2348,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2361,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) @@ -2390,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); @@ -2415,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) @@ -2450,28 +2448,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2484,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) @@ -2518,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); @@ -2566,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( @@ -2580,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) @@ -2610,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( @@ -2618,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) @@ -2652,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); @@ -2700,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( @@ -2719,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) @@ -2738,8 +2734,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2749,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( @@ -2768,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) @@ -2786,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); @@ -2834,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( @@ -2842,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) @@ -2878,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( @@ -2892,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) @@ -2920,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); @@ -2971,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) @@ -3006,8 +3002,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3016,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3031,13 +3027,13 @@ static void mine_train_rc_track_right_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; mine_train_rc_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3050,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) @@ -3091,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( @@ -3126,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( @@ -3135,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( @@ -3167,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( @@ -3176,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( @@ -3203,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( @@ -3217,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) @@ -3247,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( @@ -3255,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) @@ -3297,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( @@ -3330,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( @@ -3345,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( @@ -3372,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( @@ -3387,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( @@ -3408,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( @@ -3427,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) @@ -3446,8 +3442,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3457,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( @@ -3476,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) @@ -3502,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( @@ -3535,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( @@ -3574,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( @@ -3607,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( @@ -3615,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) @@ -3651,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( @@ -3665,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) @@ -3701,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( @@ -3735,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( @@ -3772,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( @@ -3809,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) @@ -3844,8 +3840,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3854,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3869,13 +3865,13 @@ static void mine_train_rc_track_right_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; mine_train_rc_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3883,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); @@ -3899,33 +3895,33 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { 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, 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); @@ -3933,8 +3929,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3944,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) @@ -3975,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); @@ -4005,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); @@ -4032,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); @@ -4078,8 +4074,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4089,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) @@ -4121,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); @@ -4149,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); @@ -4176,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); @@ -4222,26 +4218,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4252,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) @@ -4284,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); @@ -4315,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); @@ -4342,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); @@ -4388,8 +4384,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4399,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) @@ -4433,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); @@ -4462,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); @@ -4490,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); @@ -4536,31 +4532,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4586,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) { @@ -4594,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; } } @@ -4615,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; } } @@ -4632,24 +4628,24 @@ 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) { 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; } } @@ -4658,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; } } @@ -4678,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) { @@ -4708,13 +4704,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4740,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) { @@ -4748,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; } } @@ -4773,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; } } @@ -4794,28 +4782,24 @@ 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) { 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; } } @@ -4824,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; } } @@ -4848,7 +4828,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) { @@ -4878,8 +4858,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4902,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); @@ -4921,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); @@ -4956,13 +4936,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4988,7 +4968,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) { @@ -4996,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; } } @@ -5017,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; } } @@ -5034,24 +5014,24 @@ 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) { 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; } } @@ -5060,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; } } @@ -5080,7 +5060,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) { @@ -5110,8 +5090,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5134,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); @@ -5153,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); @@ -5188,8 +5168,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5212,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); @@ -5231,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); @@ -5266,13 +5246,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5298,7 +5278,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) { @@ -5306,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; } } @@ -5331,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; } } @@ -5352,28 +5324,24 @@ 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) { 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; } } @@ -5382,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; } } @@ -5406,7 +5370,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) { @@ -5436,13 +5400,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5468,7 +5432,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) { @@ -5476,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; } } @@ -5501,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; } } @@ -5522,28 +5478,24 @@ 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) { 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; } } @@ -5552,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; } } @@ -5576,7 +5524,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) { @@ -5606,8 +5554,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5630,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); @@ -5649,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); @@ -5684,13 +5632,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5715,7 +5663,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) { @@ -5723,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; } } @@ -5748,48 +5692,40 @@ 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; } } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { 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; } } @@ -5798,30 +5734,26 @@ 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; } } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5852,8 +5784,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5876,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); @@ -5895,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); @@ -5930,8 +5862,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5954,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); @@ -5973,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); @@ -6008,13 +5940,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6040,7 +5972,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) { @@ -6048,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; } } @@ -6069,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; } } @@ -6086,24 +6018,24 @@ 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) { 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; } } @@ -6112,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; } } @@ -6132,7 +6064,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) { @@ -6162,8 +6094,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6189,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); @@ -6208,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); @@ -6243,8 +6175,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6267,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); @@ -6286,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( @@ -6298,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); @@ -6324,8 +6256,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6351,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); @@ -6370,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); @@ -6405,8 +6337,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6429,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); @@ -6448,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( @@ -6460,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); @@ -6486,8 +6418,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6513,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); @@ -6532,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); @@ -6567,8 +6499,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6591,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); @@ -6610,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( @@ -6622,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); @@ -6648,8 +6580,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6675,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); @@ -6694,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); @@ -6729,8 +6661,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6753,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); @@ -6772,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( @@ -6784,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); @@ -6810,8 +6742,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6835,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; @@ -6852,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; @@ -6886,8 +6818,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6908,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; @@ -6925,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( @@ -6937,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; @@ -6962,8 +6894,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6989,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); @@ -7008,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); @@ -7043,8 +6975,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7067,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); @@ -7086,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( @@ -7098,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); @@ -7124,8 +7056,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7149,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( @@ -7169,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( @@ -7206,8 +7138,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7231,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( @@ -7251,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( @@ -7288,14 +7220,14 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); - 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/MiniRollerCoaster.cpp b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp index 9a4f4d1648..1639501925 100644 --- a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp @@ -32,10 +32,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -110,8 +110,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -144,10 +144,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -246,8 +246,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -303,10 +303,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -405,8 +405,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -466,8 +466,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -527,10 +527,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -629,56 +629,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -855,17 +855,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -918,8 +918,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -972,8 +972,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1026,8 +1026,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1080,8 +1080,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1268,17 +1268,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1338,8 +1338,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1399,8 +1399,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1460,8 +1460,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1521,40 +1521,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1603,16 +1603,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1789,8 +1789,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1967,26 +1967,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2134,8 +2134,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2283,8 +2283,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2400,17 +2400,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2535,17 +2535,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2637,8 +2637,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2730,26 +2730,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2994,8 +2994,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3240,8 +3240,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3638,8 +3638,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4008,8 +4008,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4073,8 +4073,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4110,24 +4110,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** rct2: 0x008A4E7C */ static void mini_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4160,8 +4160,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4217,8 +4217,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4274,8 +4274,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -4320,24 +4320,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4482,8 +4482,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4627,26 +4627,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4794,8 +4794,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4943,31 +4943,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -5107,13 +5107,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -5253,8 +5253,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5329,13 +5329,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -5475,8 +5475,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5551,8 +5551,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5627,13 +5627,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -5773,13 +5773,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -5919,8 +5919,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5995,13 +5995,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -6139,8 +6139,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6215,8 +6215,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6291,13 +6291,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -6437,8 +6437,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6516,8 +6516,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6595,8 +6595,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6674,8 +6674,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6753,8 +6753,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6832,8 +6832,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6911,8 +6911,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6990,8 +6990,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7069,8 +7069,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7146,8 +7146,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7223,8 +7223,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7302,8 +7302,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7381,8 +7381,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7457,8 +7457,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7533,10 +7533,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -7567,8 +7567,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7663,8 +7663,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7759,28 +7759,27 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; mini_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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7963,8 +7962,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8147,28 +8146,27 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; mini_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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8226,8 +8224,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8285,8 +8283,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8344,8 +8342,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8403,44 +8401,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8496,8 +8490,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8553,8 +8547,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8610,8 +8604,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8667,44 +8661,44 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8762,8 +8756,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8821,8 +8815,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8880,8 +8874,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -8939,39 +8933,39 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9062,8 +9056,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9154,8 +9148,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 70050350c3..7fef440841 100644 --- a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp @@ -20,10 +20,10 @@ /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -81,8 +81,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -107,10 +107,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -201,10 +201,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -295,10 +295,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -389,32 +389,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -600,17 +600,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -790,8 +790,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -971,8 +971,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1101,17 +1101,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1284,8 +1284,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1458,31 +1458,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1615,13 +1615,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1754,13 +1754,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1893,13 +1893,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2032,13 +2032,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2171,13 +2171,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2307,13 +2307,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 30b5c07847..c20a381911 100644 --- a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp @@ -35,12 +35,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -119,8 +119,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, @@ -145,30 +145,29 @@ 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); 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,12 +179,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -315,10 +314,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -396,12 +395,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -531,10 +530,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -622,10 +621,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -737,12 +736,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -872,60 +871,58 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -1289,19 +1286,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1378,10 +1375,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1458,10 +1455,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1538,10 +1535,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1618,10 +1615,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -1986,20 +1983,20 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; multi_dimension_rc_track_banked_left_quarter_turn_5( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2107,10 +2104,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2218,10 +2215,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2329,10 +2326,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2440,46 +2437,42 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2552,18 +2545,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -2875,10 +2868,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3190,10 +3183,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3427,19 +3420,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3679,18 +3672,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3905,8 +3897,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4121,8 +4113,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4131,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4146,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4491,8 +4483,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4831,8 +4823,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4841,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4856,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -4921,10 +4913,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -4969,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); @@ -5023,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); @@ -5032,10 +5024,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5113,18 +5105,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5210,19 +5202,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -5300,10 +5291,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5387,10 +5378,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5692,10 +5683,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5997,28 +5988,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -6321,10 +6312,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -6627,35 +6618,33 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6683,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) { @@ -6711,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) { @@ -6739,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) { @@ -6801,7 +6790,7 @@ static void multi_dimension_rc_track_diag_flat( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6829,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) { @@ -6857,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) { @@ -6885,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) { @@ -6939,15 +6928,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6975,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) { @@ -7003,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) { @@ -7031,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) { @@ -7093,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) { @@ -7121,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) { @@ -7149,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) { @@ -7177,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) { @@ -7231,10 +7220,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -7397,15 +7386,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7433,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) { @@ -7461,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) { @@ -7489,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) { @@ -7551,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) { @@ -7579,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) { @@ -7607,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) { @@ -7635,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) { @@ -7689,10 +7678,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -7855,10 +7844,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8021,15 +8010,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8057,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) { @@ -8085,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) { @@ -8113,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) { @@ -8175,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) { @@ -8203,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) { @@ -8231,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) { @@ -8259,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) { @@ -8313,15 +8302,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8349,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) { @@ -8377,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) { @@ -8405,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) { @@ -8549,10 +8538,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8715,15 +8704,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8750,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) { @@ -8777,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) { @@ -8804,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) { @@ -8947,10 +8936,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -9113,10 +9102,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -9279,15 +9268,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9315,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) { @@ -9343,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) { @@ -9371,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) { @@ -9515,10 +9504,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -9685,10 +9674,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -9855,10 +9844,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10025,10 +10014,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10195,10 +10184,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10364,10 +10353,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10533,10 +10522,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10702,10 +10691,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10871,10 +10860,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11033,10 +11022,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11195,10 +11184,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11364,10 +11353,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11533,10 +11522,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11700,10 +11689,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11867,8 +11856,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11979,8 +11968,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -12089,8 +12078,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -12201,8 +12190,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -12311,10 +12300,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12510,12 +12499,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -12561,10 +12550,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12756,10 +12745,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12955,10 +12944,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 fb860fb3c0..e4c1c12cef 100644 --- a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp @@ -196,30 +196,30 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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); } - 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); } static void paint_reverse_freefall_rc_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -227,42 +227,39 @@ 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]; 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) { // 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]; 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); } - 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, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); } static void paint_reverse_freefall_rc_slope( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { TESTPAINT_IGNORE_ALL(); @@ -307,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) @@ -324,7 +320,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); @@ -349,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; @@ -357,8 +353,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t supportsImageId, trackImageId; switch (trackSequence) @@ -366,7 +362,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; @@ -388,8 +384,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_AIR_POWERED_VERTICAL_RC_FLAT_SW_NE, @@ -401,7 +397,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; @@ -412,9 +408,9 @@ 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, 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 bb9b68d4be..aaabb4d2e2 100644 --- a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp @@ -47,10 +47,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -92,8 +92,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { 21506, SPR_STATION_BASE_A_SW_NE }, @@ -107,8 +107,8 @@ 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); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + 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); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -116,32 +116,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { 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; } } @@ -185,32 +185,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { 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; } } @@ -254,32 +254,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { 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; } } @@ -323,32 +323,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -528,17 +528,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -676,8 +676,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -815,8 +815,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -922,17 +922,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** rct2: 0x0086E75C */ static void reverser_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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); @@ -956,8 +956,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -1141,8 +1141,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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 b01962c004..da4d84a5b7 100644 --- a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp @@ -67,10 +67,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -139,8 +139,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { 21610, @@ -151,8 +151,8 @@ 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); + 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); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -160,10 +160,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -245,10 +245,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -330,10 +330,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -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; } } @@ -415,32 +415,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -680,17 +680,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -876,8 +876,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -1063,8 +1063,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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) @@ -1206,17 +1206,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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); @@ -1244,8 +1244,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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); @@ -1437,8 +1437,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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); @@ -1629,31 +1629,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -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; } } @@ -1731,15 +1731,15 @@ 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) { 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; } } @@ -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) { @@ -1813,13 +1813,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -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; } } @@ -1905,17 +1897,15 @@ 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) { 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; } } @@ -1965,7 +1949,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) { @@ -1995,13 +1979,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2027,7 +2011,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) { @@ -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; } } @@ -2079,15 +2063,15 @@ 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) { 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; } } @@ -2131,7 +2115,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) { @@ -2161,13 +2145,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2193,7 +2177,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) { @@ -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; } } @@ -2253,17 +2229,15 @@ 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) { 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; } } @@ -2313,7 +2281,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) { @@ -2343,13 +2311,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2375,7 +2343,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) { @@ -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; } } @@ -2435,17 +2395,15 @@ 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) { 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; } } @@ -2495,7 +2447,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) { @@ -2525,13 +2477,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2555,7 +2507,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) { @@ -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,36 +2542,30 @@ 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; } } break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { 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,18 +2598,16 @@ 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; } } break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2702,13 +2638,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2734,7 +2670,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) { @@ -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; } } @@ -2786,15 +2722,15 @@ 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) { 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; } } @@ -2838,7 +2774,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) { @@ -2867,8 +2803,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -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; } @@ -2926,15 +2862,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -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; } @@ -2989,15 +2925,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -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; } @@ -3052,15 +2988,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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); @@ -3144,15 +3080,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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); @@ -3240,16 +3176,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); }; 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -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); @@ -3335,11 +3271,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, 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 363c90fa93..b846c6f979 100644 --- a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp @@ -27,10 +27,10 @@ namespace SingleRailRC { static void TrackFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -91,8 +91,8 @@ namespace SingleRailRC } static void TrackStation( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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,17 +117,17 @@ 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, 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); } static void Track25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -203,10 +203,10 @@ namespace SingleRailRC } static void Track60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -282,10 +282,10 @@ namespace SingleRailRC } static void TrackFlatTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -361,10 +361,10 @@ namespace SingleRailRC } static void Track25DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -452,10 +452,10 @@ namespace SingleRailRC } static void Track60DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -543,10 +543,10 @@ namespace SingleRailRC } static void Track25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -622,50 +622,50 @@ namespace SingleRailRC } static void Track25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track60DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track60DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpTo60DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -704,15 +704,15 @@ namespace SingleRailRC } static void Track90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track90DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegUpTo90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -760,15 +760,15 @@ namespace SingleRailRC } static void Track90DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track60DegUpTo90DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -808,8 +808,8 @@ namespace SingleRailRC } static void Track60DegDownTo90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -851,8 +851,8 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn3( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -979,16 +979,16 @@ namespace SingleRailRC } static void TrackRightQuarterTurn3( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1188,16 +1188,16 @@ namespace SingleRailRC } static void TrackRightQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftEighthToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1361,8 +1361,8 @@ namespace SingleRailRC } static void TrackRightEighthToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1526,29 +1526,29 @@ namespace SingleRailRC } static void TrackLeftEighthToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthToDiag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthToDiag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightEighthToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthToDiag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthToDiag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } static void TrackDiagFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1699,13 +1699,13 @@ namespace SingleRailRC } static void TrackDiag25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1856,13 +1856,13 @@ namespace SingleRailRC } static void TrackDiag25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2013,13 +2013,13 @@ namespace SingleRailRC } static void TrackDiagFlatTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2170,13 +2170,13 @@ namespace SingleRailRC } static void TrackDiag25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2327,13 +2327,13 @@ namespace SingleRailRC } static void TrackDiagFlatTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2482,13 +2482,13 @@ namespace SingleRailRC } static void TrackDiag25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2639,13 +2639,13 @@ namespace SingleRailRC } static void TrackDiag60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2796,13 +2796,13 @@ namespace SingleRailRC } static void TrackDiag25DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2953,13 +2953,13 @@ namespace SingleRailRC } static void TrackDiag60DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -3110,13 +3110,13 @@ namespace SingleRailRC } static void TrackDiag60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -3267,13 +3267,13 @@ namespace SingleRailRC } static void TrackDiag25DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -3424,13 +3424,13 @@ namespace SingleRailRC } static void TrackDiag60DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -3581,8 +3581,8 @@ namespace SingleRailRC } static void TrackFlatToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3624,8 +3624,8 @@ namespace SingleRailRC } static void TrackFlatToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3667,22 +3667,22 @@ namespace SingleRailRC } static void TrackLeftBankToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatToRightBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatToLeftBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3731,8 +3731,8 @@ namespace SingleRailRC } static void TrackRightBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3781,8 +3781,8 @@ namespace SingleRailRC } static void Track25DegUpToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3831,8 +3831,8 @@ namespace SingleRailRC } static void Track25DegUpToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3881,36 +3881,36 @@ namespace SingleRailRC } static void TrackLeftBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpToRightBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpToLeftBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBankTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBankTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -3946,15 +3946,15 @@ namespace SingleRailRC } static void TrackRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackDiagFlatToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4040,8 +4040,8 @@ namespace SingleRailRC } static void TrackDiagFlatToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4127,8 +4127,8 @@ namespace SingleRailRC } static void TrackDiagLeftBankToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4214,8 +4214,8 @@ namespace SingleRailRC } static void TrackDiagRightBankToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4301,8 +4301,8 @@ namespace SingleRailRC } static void TrackDiagLeftBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4388,8 +4388,8 @@ namespace SingleRailRC } static void TrackDiagRightBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4475,8 +4475,8 @@ namespace SingleRailRC } static void TrackDiag25DegUpToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4562,8 +4562,8 @@ namespace SingleRailRC } static void TrackDiag25DegUpToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4649,8 +4649,8 @@ namespace SingleRailRC } static void TrackDiagLeftBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4734,8 +4734,8 @@ namespace SingleRailRC } static void TrackDiagRightBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4819,8 +4819,8 @@ namespace SingleRailRC } static void TrackDiag25DegDownToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4906,8 +4906,8 @@ namespace SingleRailRC } static void TrackDiag25DegDownToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4993,8 +4993,8 @@ namespace SingleRailRC } static void TrackDiagLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5076,8 +5076,8 @@ namespace SingleRailRC } static void TrackDiagRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5159,8 +5159,8 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn3Bank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5295,16 +5295,16 @@ namespace SingleRailRC } static void TrackRightQuarterTurn3Bank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackBankedLeftQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5512,16 +5512,16 @@ namespace SingleRailRC } static void TrackBankedRightQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackBankedLeftQuarterTurn5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackBankedLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftEighthBankToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5685,8 +5685,8 @@ namespace SingleRailRC } static void TrackRightEighthBankToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5850,24 +5850,24 @@ namespace SingleRailRC } static void TrackLeftEighthBankToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthBankToDiag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthBankToDiag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightEighthBankToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthBankToDiag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthBankToDiag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } static void TrackLeftQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5964,8 +5964,8 @@ namespace SingleRailRC } static void TrackRightQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6068,24 +6068,24 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn525DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6285,8 +6285,8 @@ namespace SingleRailRC } static void TrackRightQuarterTurn525DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6486,24 +6486,24 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn525DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightQuarterTurn525DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn525DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn525DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn525DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn525DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn160DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6546,8 +6546,8 @@ namespace SingleRailRC } static void TrackRightQuarterTurn160DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6590,22 +6590,22 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn160DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightQuarterTurn160DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn160DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn160DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftQuarterTurn160DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn160DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn190DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6656,8 +6656,8 @@ namespace SingleRailRC } static void TrackRightQuarterTurn190DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6708,22 +6708,22 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn190DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightQuarterTurn190DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn190DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn190DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftQuarterTurn190DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn190DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void Track25DegUpToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6774,8 +6774,8 @@ namespace SingleRailRC } static void Track25DegUpToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6826,8 +6826,8 @@ namespace SingleRailRC } static void TrackLeftBanked25DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6878,8 +6878,8 @@ namespace SingleRailRC } static void TrackRightBanked25DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6930,36 +6930,36 @@ namespace SingleRailRC } static void TrackLeftBanked25DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBanked25DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBanked25DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedFlatToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7006,8 +7006,8 @@ namespace SingleRailRC } static void TrackRightBankedFlatToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7054,8 +7054,8 @@ namespace SingleRailRC } static void TrackLeftBanked25DegUpToLeftBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7102,8 +7102,8 @@ namespace SingleRailRC } static void TrackRightBanked25DegUpToRightBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7150,36 +7150,36 @@ namespace SingleRailRC } static void TrackLeftBankedFlatToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBanked25DegUpToRightBankedFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToRightBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankedFlatToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBanked25DegUpToLeftBankedFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToLeftBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToLeftBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBankedFlatToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankedFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToRightBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBankedFlatToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankedFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegUpLeftBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7226,8 +7226,8 @@ namespace SingleRailRC } static void Track25DegUpRightBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7274,22 +7274,22 @@ namespace SingleRailRC } static void Track25DegDownLeftBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpRightBanked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpRightBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownRightBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track25DegUpLeftBanked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpLeftBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7340,8 +7340,8 @@ namespace SingleRailRC } static void TrackFlatToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7392,8 +7392,8 @@ namespace SingleRailRC } static void TrackLeftBanked25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7444,8 +7444,8 @@ namespace SingleRailRC } static void TrackRightBanked25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -7496,36 +7496,36 @@ namespace SingleRailRC } static void TrackFlatToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBanked25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBanked25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7622,8 +7622,8 @@ namespace SingleRailRC } static void TrackRightBankedQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7726,24 +7726,24 @@ namespace SingleRailRC } static void TrackLeftBankedQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightBankedQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightBankedQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftBankedQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftBankedQuarterTurn525DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7943,8 +7943,8 @@ namespace SingleRailRC } static void TrackRightBankedQuarterTurn525DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8144,24 +8144,24 @@ namespace SingleRailRC } static void TrackLeftBankedQuarterTurn525DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightBankedQuarterTurn525DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn525DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightBankedQuarterTurn525DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftBankedQuarterTurn525DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn525DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackSBendLeft( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8314,8 +8314,8 @@ namespace SingleRailRC } static void TrackSBendRight( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8468,8 +8468,8 @@ namespace SingleRailRC } static void TrackLeftHalfBankedHelixUpSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8735,8 +8735,8 @@ namespace SingleRailRC } static void TrackRightHalfBankedHelixUpSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9002,8 +9002,8 @@ namespace SingleRailRC } static void TrackLeftHalfBankedHelixDownSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -9011,12 +9011,12 @@ 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, trackElement); } static void TrackRightHalfBankedHelixDownSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -9024,12 +9024,12 @@ 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, trackElement); } static void TrackLeftHalfBankedHelixUpLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9440,8 +9440,8 @@ namespace SingleRailRC } } static void TrackRightHalfBankedHelixUpLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9865,8 +9865,8 @@ namespace SingleRailRC } static void TrackLeftHalfBankedHelixDownLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -9874,12 +9874,12 @@ 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, trackElement); } static void TrackRightHalfBankedHelixDownLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -9887,12 +9887,12 @@ 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, trackElement); } static void TrackLeftBarrelRollUpToDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10072,8 +10072,8 @@ namespace SingleRailRC } static void TrackRightBarrelRollUpToDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10253,22 +10253,22 @@ namespace SingleRailRC } static void TrackLeftBarrelRollDownToUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftBarrelRollUpToDown(session, rideIndex, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBarrelRollDownToUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightBarrelRollUpToDown(session, rideIndex, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackHalfLoopUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10408,15 +10408,15 @@ namespace SingleRailRC } static void TrackHalfLoopDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackHalfLoopUp(session, rideIndex, 3 - trackSequence, direction, height, tileElement); + TrackHalfLoopUp(session, ride, 3 - trackSequence, direction, height, trackElement); } static void TrackBrakes( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -10444,8 +10444,8 @@ namespace SingleRailRC } static void TrackOnRidePhoto( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -10494,15 +10494,15 @@ 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); } static void TrackFlatTo60DegUpLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10670,8 +10670,8 @@ namespace SingleRailRC } } static void Track60DegUpToFlatLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10840,22 +10840,22 @@ namespace SingleRailRC } static void TrackFlatTo60DegDownLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track60DegUpToFlatLongBase(session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpToFlatLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownToFlatLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatTo60DegUpLongBase(session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo60DegUpLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackBlockBrakes( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -10883,8 +10883,8 @@ namespace SingleRailRC } static void TrackLeftCorkscrewUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11000,8 +11000,8 @@ namespace SingleRailRC } static void TrackRightCorkscrewUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11115,22 +11115,22 @@ namespace SingleRailRC } static void TrackLeftCorkscrewDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightCorkscrewUp(session, rideIndex, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightCorkscrewUp(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightCorkscrewDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftCorkscrewUp(session, rideIndex, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftCorkscrewUp(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); } static void Track90DegToInvertedFlatQuarterLoopUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11238,15 +11238,15 @@ namespace SingleRailRC } static void TrackInvertedFlatTo90DegQuarterLoopDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track90DegToInvertedFlatQuarterLoopUp(session, rideIndex, 2 - trackSequence, direction, height, tileElement); + Track90DegToInvertedFlatQuarterLoopUp(session, ride, 2 - trackSequence, direction, height, trackElement); } static void TrackLeftBankToLeftQuarterTurn3Tile25DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11347,8 +11347,8 @@ namespace SingleRailRC } static void TrackRightBankToRightQuarterTurn3Tile25DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11449,8 +11449,8 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn3Tile25DegDownToLeftBank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11551,8 +11551,8 @@ namespace SingleRailRC } static void TrackRightQuarterTurn3Tile25DegDownToRightBank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11653,8 +11653,8 @@ namespace SingleRailRC } static void TrackLeftLargeHalfLoopUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11925,8 +11925,8 @@ namespace SingleRailRC } static void TrackRightLargeHalfLoopUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -12197,24 +12197,24 @@ namespace SingleRailRC } static void TrackRightLargeHalfLoopDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackRightLargeHalfLoopUp(session, rideIndex, 6 - trackSequence, direction, height, tileElement); + TrackRightLargeHalfLoopUp(session, ride, 6 - trackSequence, direction, height, trackElement); } static void TrackLeftLargeHalfLoopDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackLeftLargeHalfLoopUp(session, rideIndex, 6 - trackSequence, direction, height, tileElement); + TrackLeftLargeHalfLoopUp(session, ride, 6 - trackSequence, direction, height, trackElement); } static void TrackFlatTo60DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12320,10 +12320,10 @@ namespace SingleRailRC } static void Track60DegUpToFlat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12415,27 +12415,27 @@ namespace SingleRailRC } static void TrackFlatTo60DegDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - Track60DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownToFlat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - TrackFlatTo60DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackDiagFlatTo60DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -12586,13 +12586,13 @@ namespace SingleRailRC } static void TrackDiag60DegUpToFlat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -12743,13 +12743,13 @@ namespace SingleRailRC } static void TrackDiagFlatTo60DegDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -12900,13 +12900,13 @@ namespace SingleRailRC } static void TrackDiag60DegDownToFlat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 e4a419055d..b1dad02567 100644 --- a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp @@ -32,10 +32,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -89,8 +89,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -123,10 +123,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -193,10 +193,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -263,10 +263,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -333,10 +333,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -411,10 +411,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -489,10 +489,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -559,56 +559,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -764,17 +764,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -807,8 +807,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -841,8 +841,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -875,8 +875,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -909,8 +909,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1083,17 +1083,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1133,8 +1133,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1174,8 +1174,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1215,8 +1215,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1256,40 +1256,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1322,21 +1322,21 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1618,13 +1618,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1906,28 +1906,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2061,8 +2059,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2196,8 +2194,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2453,8 +2451,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2678,8 +2676,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2778,17 +2776,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2899,22 +2897,22 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2977,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) { @@ -3043,13 +3041,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3112,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) { @@ -3190,28 +3188,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3336,16 +3332,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3456,8 +3452,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3569,24 +3565,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3803,8 +3799,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4021,8 +4017,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4030,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4045,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4393,8 +4387,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4735,8 +4729,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4744,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4759,14 +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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4793,8 +4785,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -4827,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); @@ -4835,8 +4827,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4974,8 +4966,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5112,26 +5104,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5272,8 +5264,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5413,31 +5405,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5464,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) { @@ -5491,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) { @@ -5518,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) { @@ -5577,13 +5569,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5610,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) { @@ -5637,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) { @@ -5664,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) { @@ -5723,13 +5715,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5756,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) { @@ -5783,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) { @@ -5810,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) { @@ -5869,13 +5861,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5902,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) { @@ -5929,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) { @@ -5956,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) { @@ -6015,13 +6007,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6048,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) { @@ -6075,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) { @@ -6102,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) { @@ -6161,13 +6153,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6194,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) { @@ -6221,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) { @@ -6248,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) { @@ -6307,13 +6299,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6340,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) { @@ -6367,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) { @@ -6394,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) { @@ -6453,13 +6445,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6486,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) { @@ -6513,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) { @@ -6540,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) { @@ -6599,13 +6591,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6632,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) { @@ -6659,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) { @@ -6686,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) { @@ -6745,13 +6737,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6777,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) { @@ -6803,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) { @@ -6829,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) { @@ -6889,13 +6881,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6922,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) { @@ -6949,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) { @@ -6976,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) { @@ -7035,13 +7027,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7068,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) { @@ -7095,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) { @@ -7122,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) { @@ -7181,13 +7173,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7214,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) { @@ -7241,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) { @@ -7268,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) { @@ -7327,8 +7319,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7406,8 +7398,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7485,8 +7477,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7564,8 +7556,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7643,8 +7635,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7722,8 +7714,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7801,8 +7793,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7880,8 +7872,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7959,8 +7951,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8036,8 +8028,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8113,8 +8105,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8192,8 +8184,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8271,8 +8263,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8347,8 +8339,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8423,10 +8415,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 bf05e574f2..5c687cc0da 100644 --- a/src/openrct2/ride/coaster/Steeplechase.cpp +++ b/src/openrct2/ride/coaster/Steeplechase.cpp @@ -20,10 +20,10 @@ /** rct2: 0x008A59A8 */ static void steeplechase_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -70,8 +70,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -95,10 +95,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -173,10 +173,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -251,10 +251,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -329,32 +329,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -524,17 +524,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -682,8 +682,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -831,8 +831,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -945,17 +945,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** rct2: 0x008A5AA8 */ static void steeplechase_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -981,8 +981,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1127,8 +1127,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1272,31 +1272,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** rct2: 0x008A5AC8 */ static void steeplechase_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1436,13 +1436,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1582,13 +1582,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1728,13 +1728,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -1874,13 +1874,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2020,13 +2020,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2164,13 +2164,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -2310,8 +2310,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { diff --git a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp index e304d1a82b..ac7f82eb50 100644 --- a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp +++ b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp @@ -20,10 +20,10 @@ /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -73,8 +73,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -100,10 +100,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -194,8 +194,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -235,10 +235,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -329,8 +329,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -376,10 +376,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -482,10 +482,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -576,58 +576,56 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -806,18 +804,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -982,8 +979,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1148,28 +1145,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1327,8 +1324,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1486,8 +1483,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1605,18 +1602,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1702,8 +1698,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1789,28 +1785,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1841,8 +1837,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2026,8 +2022,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2211,8 +2207,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2396,8 +2392,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2581,8 +2577,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2744,8 +2740,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2907,33 +2903,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2960,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) { @@ -2987,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) { @@ -3014,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) { @@ -3066,13 +3060,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3099,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) { @@ -3126,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) { @@ -3153,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) { @@ -3205,8 +3199,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3288,13 +3282,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3321,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) { @@ -3348,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) { @@ -3375,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) { @@ -3427,8 +3421,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3510,8 +3504,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3593,13 +3587,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3626,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) { @@ -3653,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) { @@ -3680,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) { @@ -3732,13 +3726,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3765,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) { @@ -3792,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) { @@ -3819,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) { @@ -3871,8 +3865,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3933,13 +3927,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3965,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) { @@ -3991,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) { @@ -4017,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) { @@ -4069,8 +4063,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4152,8 +4146,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4235,13 +4229,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4268,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) { @@ -4295,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) { @@ -4322,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) { @@ -4374,8 +4368,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { diff --git a/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp b/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp index a9453b8903..e3a9e51577 100644 --- a/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp @@ -21,1596 +21,1586 @@ /** rct2: 0x008AB6A4 */ static void twister_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_flat(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_station(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_banked_left_quarter_turn_5( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_banked_right_quarter_turn_5( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_left_bank(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_vertical_loop( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_vertical_loop( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_up_small( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_up_small( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_down_small( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_down_small( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_up_large( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_up_large( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_down_large( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_down_large( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_brakes(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_left_banked( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_right_banked( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_left_banked( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_right_banked( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_90_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_90_deg_down_to_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_90_deg_up_to_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_90_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_to_diag( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_to_diag( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_to_orthogonal( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_to_orthogonal( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_bank_to_diag( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_bank_to_diag( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_bank_to_orthogonal( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_bank_to_orthogonal( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_diag_flat(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_block_brakes( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_brake_for_drop( - session, rideIndex, 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_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_half_loop_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_corkscrew_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_corkscrew_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_corkscrew_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_corkscrew_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_up_long_base( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_down_long_base( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base122( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_barrel_roll_up_to_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_barrel_roll_up_to_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_barrel_roll_down_to_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_barrel_roll_down_to_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_powered_lift( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_large_half_loop_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_large_half_loop_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_large_half_loop_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_large_half_loop_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_booster(session, rideIndex, 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 2a15f7b474..5d6d1fa691 100644 --- a/src/openrct2/ride/coaster/VerticalDropRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/VerticalDropRollerCoaster.cpp @@ -14,1583 +14,1573 @@ /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_flat(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_station(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_banked_left_quarter_turn_5( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_banked_right_quarter_turn_5( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_left_bank(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_vertical_loop( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_vertical_loop( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_up_small( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_up_small( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_down_small( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_down_small( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_up_large( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_up_large( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_down_large( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_down_large( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_brakes(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_left_banked( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_right_banked( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_left_banked( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_right_banked( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_90_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_90_deg_down_to_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_90_deg_up_to_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_90_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_to_diag( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_to_diag( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_to_orthogonal( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_to_orthogonal( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_bank_to_diag( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_bank_to_diag( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_bank_to_orthogonal( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_bank_to_orthogonal( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_diag_flat(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_left_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_block_brakes( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_brake_for_drop( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_down_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_half_loop_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_corkscrew_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_corkscrew_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_corkscrew_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_corkscrew_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_up_long_base( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_down_long_base( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base122( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_barrel_roll_up_to_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_barrel_roll_up_to_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_barrel_roll_down_to_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_barrel_roll_down_to_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_powered_lift( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_large_half_loop_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_large_half_loop_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_right_large_half_loop_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bolliger_mabillard_track_left_large_half_loop_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bolliger_mabillard_track_booster(session, rideIndex, 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 64515f12ba..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] = { @@ -182,7 +194,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()) { @@ -209,11 +222,11 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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; } @@ -221,16 +234,16 @@ 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); } - 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); @@ -238,11 +251,11 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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; } @@ -252,11 +265,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) @@ -267,19 +280,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; } @@ -290,11 +303,11 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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; } @@ -304,29 +317,29 @@ 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); + 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, 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); + 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, 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); + 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, 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); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); break; } @@ -337,11 +350,11 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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; } @@ -351,11 +364,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) @@ -366,19 +379,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; } @@ -389,39 +402,39 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; 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 +444,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); @@ -439,19 +452,24 @@ 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); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + 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); 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_3_tiles_paint( session, 2, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -467,8 +485,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; } @@ -476,22 +494,27 @@ 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_1_tile_paint( session, 2, height, 0, direction, session->TrackColours[SCHEME_TRACK], @@ -500,18 +523,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; @@ -523,11 +546,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index 406a3b7ca8..8911e33f2e 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -165,8 +165,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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)) @@ -189,8 +189,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -225,8 +225,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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)) @@ -257,8 +257,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -303,8 +303,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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)) @@ -335,8 +335,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) @@ -382,8 +382,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) @@ -429,8 +429,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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)) @@ -461,55 +461,55 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][3] = { { @@ -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( @@ -564,8 +564,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][2] = { { @@ -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 }; @@ -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( @@ -623,18 +623,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][2] = { { @@ -652,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 }; @@ -661,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); @@ -703,26 +701,25 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_WILD_MOUSE_QUARTER_TURN_1_SW_NE, @@ -735,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, 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); + 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]); @@ -756,16 +753,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -780,7 +777,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) @@ -811,8 +808,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -827,7 +824,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) @@ -865,24 +862,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** rct2: 0x0078B344 */ static void wild_mouse_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -898,8 +895,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_WILD_MOUSE_ROTATION_CONTROL_TOGGLE_SW_NE, @@ -922,10 +919,10 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 1e41d69211..f1fd868339 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -428,8 +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), 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, { 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, @@ -438,8 +438,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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,19 +454,19 @@ 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); - 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); } static void wooden_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -490,8 +490,8 @@ 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); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + 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); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -499,29 +499,65 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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 = 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); @@ -531,8 +567,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) { @@ -549,8 +584,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -569,8 +604,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) { @@ -587,29 +621,65 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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 = 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); @@ -619,8 +689,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) { @@ -637,16 +706,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) @@ -661,8 +748,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) { @@ -679,16 +765,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) @@ -703,8 +807,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) { @@ -721,29 +824,65 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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 = 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); @@ -753,8 +892,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) { @@ -771,249 +909,385 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -1029,7 +1303,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; @@ -1064,25 +1338,43 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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( @@ -1092,7 +1384,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); @@ -1100,16 +1392,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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( @@ -1119,7 +1429,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); @@ -1127,217 +1437,353 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -1353,7 +1799,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; @@ -1388,25 +1834,43 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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( @@ -1416,8 +1880,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); @@ -1432,16 +1895,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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( @@ -1451,8 +1932,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); @@ -1467,16 +1947,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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( @@ -1486,8 +1984,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); @@ -1502,16 +1999,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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( @@ -1521,8 +2036,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); @@ -1537,40 +2051,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -1581,7 +2095,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); @@ -1589,16 +2103,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1610,7 +2124,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 +2137,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 +2174,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 +2187,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 +2196,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 +2211,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 +2231,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 +2246,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 +2255,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 +2268,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 +2294,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 +2307,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 +2320,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 +2335,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 +2353,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 +2366,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 +2379,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 +2392,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) @@ -1898,8 +2412,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1911,14 +2425,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 +2445,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 +2483,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 +2492,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 +2505,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 +2536,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 +2545,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 +2560,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 +2569,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 +2601,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 +2614,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 +2627,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 +2636,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 +2660,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 +2673,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 +2686,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) @@ -2199,26 +2713,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2230,7 +2744,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 +2757,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 +2777,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 +2795,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 +2808,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 +2828,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 +2846,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 +2859,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 +2879,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 +2897,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 +2910,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 +2930,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) @@ -2436,8 +2950,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2455,14 +2969,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 +2989,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 +3020,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 +3040,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 +3071,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 +3091,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 +3122,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 +3142,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) @@ -2655,8 +3169,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -2912,8 +3426,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3137,8 +3651,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3150,7 +3664,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 +3677,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 +3697,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 +3768,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 +3781,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 +3801,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) @@ -3307,17 +3821,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3329,7 +3843,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 +3856,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 +3876,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 +3947,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 +3960,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 +3980,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) @@ -3486,17 +4000,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3508,7 +4022,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 +4035,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 +4055,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 +4081,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 +4094,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 +4107,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 +4120,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) @@ -3626,8 +4140,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3645,14 +4159,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 +4179,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 +4218,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 +4231,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 +4244,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) @@ -3757,26 +4271,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -3788,7 +4302,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 +4315,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 +4335,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 +4353,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 +4425,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 +4438,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 +4458,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 +4491,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 +4511,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 +4541,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 +4619,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 +4639,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) @@ -4151,8 +4665,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4170,14 +4684,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 +4704,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 +4729,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 +4807,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 +4827,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 +4861,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 +4874,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 +4894,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 +4917,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 +4989,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 +5002,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 +5022,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) @@ -4527,8 +5041,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4536,14 +5050,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4551,14 +5064,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -4570,7 +5082,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( @@ -4583,14 +5095,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( @@ -4603,7 +5115,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) @@ -4630,7 +5142,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( @@ -4643,7 +5155,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( @@ -4652,7 +5164,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( @@ -4667,7 +5179,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( @@ -4687,7 +5199,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( @@ -4702,7 +5214,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( @@ -4711,7 +5223,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( @@ -4724,7 +5236,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( @@ -4748,7 +5260,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( @@ -4761,14 +5273,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( @@ -4783,7 +5295,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( @@ -4801,7 +5313,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( @@ -4814,14 +5326,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( @@ -4834,7 +5346,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) @@ -4867,14 +5379,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( @@ -4887,14 +5399,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) @@ -4934,14 +5446,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( @@ -4954,7 +5466,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( @@ -4963,7 +5475,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( @@ -4987,7 +5499,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( @@ -4996,7 +5508,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( @@ -5011,7 +5523,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( @@ -5020,7 +5532,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( @@ -5050,7 +5562,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( @@ -5059,7 +5571,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( @@ -5072,14 +5584,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( @@ -5103,14 +5615,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( @@ -5123,14 +5635,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) @@ -5149,8 +5661,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -5168,14 +5680,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( @@ -5188,14 +5700,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) @@ -5230,7 +5742,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( @@ -5239,7 +5751,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( @@ -5252,14 +5764,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( @@ -5283,7 +5795,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( @@ -5292,7 +5804,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( @@ -5307,7 +5819,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( @@ -5316,7 +5828,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( @@ -5346,14 +5858,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( @@ -5366,7 +5878,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( @@ -5375,7 +5887,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( @@ -5399,14 +5911,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( @@ -5419,14 +5931,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) @@ -5453,7 +5965,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( @@ -5466,14 +5978,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( @@ -5486,7 +5998,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) @@ -5520,7 +6032,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( @@ -5533,14 +6045,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( @@ -5555,7 +6067,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( @@ -5575,7 +6087,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( @@ -5590,7 +6102,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( @@ -5599,7 +6111,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( @@ -5612,7 +6124,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( @@ -5634,7 +6146,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( @@ -5647,7 +6159,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( @@ -5656,7 +6168,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( @@ -5671,7 +6183,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( @@ -5689,7 +6201,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( @@ -5702,14 +6214,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( @@ -5722,7 +6234,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) @@ -5741,8 +6253,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -5750,14 +6262,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -5765,14 +6276,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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -5824,8 +6334,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -5877,24 +6387,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** rct2: 0x008AC868 */ static void wooden_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WOODEN_RC_BRAKES_SW_NE, SPR_WOODEN_RC_BRAKES_RAILS_SW_NE }, @@ -5905,7 +6415,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); @@ -5913,8 +6423,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -5923,7 +6433,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( @@ -5934,7 +6444,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( @@ -5945,14 +6455,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) @@ -5969,8 +6479,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -5979,7 +6489,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( @@ -5990,7 +6500,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( @@ -6001,14 +6511,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) @@ -6025,8 +6535,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -6055,8 +6565,8 @@ 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); - track_paint_util_onride_photo_small_paint(session, direction, height + 16, tileElement); + 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); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -6064,24 +6574,24 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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; @@ -6172,7 +6682,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); @@ -6261,7 +6771,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; @@ -6311,7 +6821,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; @@ -6399,7 +6909,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; @@ -6487,7 +6997,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); @@ -6497,8 +7007,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6510,7 +7020,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( @@ -6523,14 +7033,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( @@ -6543,7 +7053,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) @@ -6561,7 +7071,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( @@ -6574,7 +7084,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( @@ -6583,7 +7093,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( @@ -6598,7 +7108,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); @@ -6614,7 +7124,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( @@ -6629,7 +7139,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( @@ -6638,7 +7148,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( @@ -6651,7 +7161,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); @@ -6661,16 +7171,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); @@ -6730,8 +7240,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6749,14 +7259,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( @@ -6769,14 +7279,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) @@ -6802,7 +7312,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( @@ -6811,7 +7321,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( @@ -6824,14 +7334,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); @@ -6851,7 +7361,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( @@ -6860,7 +7370,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( @@ -6873,7 +7383,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( @@ -6882,7 +7392,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); @@ -6892,16 +7402,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); @@ -6961,26 +7471,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -6992,7 +7502,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( @@ -7005,14 +7515,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( @@ -7025,7 +7535,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) @@ -7043,7 +7553,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( @@ -7056,7 +7566,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( @@ -7065,7 +7575,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( @@ -7080,7 +7590,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); @@ -7096,7 +7606,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( @@ -7111,7 +7621,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( @@ -7120,7 +7630,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( @@ -7133,7 +7643,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); @@ -7143,16 +7653,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); @@ -7212,8 +7722,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7231,14 +7741,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( @@ -7251,14 +7761,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) @@ -7284,7 +7794,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( @@ -7293,7 +7803,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( @@ -7306,14 +7816,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); @@ -7333,7 +7843,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( @@ -7342,7 +7852,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( @@ -7355,7 +7865,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( @@ -7364,7 +7874,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); @@ -7374,16 +7884,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); @@ -7443,31 +7953,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7499,7 +8009,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) { @@ -7516,16 +8026,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; } } @@ -7546,16 +8056,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; } } @@ -7563,15 +8073,15 @@ 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) { 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( @@ -7586,10 +8096,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; } } @@ -7598,10 +8108,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( @@ -7616,10 +8126,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; } } @@ -7627,7 +8137,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) { @@ -7663,13 +8173,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7701,7 +8211,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) { @@ -7718,20 +8228,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; } } @@ -7752,20 +8258,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; } } @@ -7773,17 +8275,15 @@ 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) { 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( @@ -7798,12 +8298,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; } } @@ -7812,12 +8310,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( @@ -7832,12 +8328,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; } } @@ -7845,7 +8339,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) { @@ -7881,8 +8375,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -7917,16 +8411,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); @@ -7936,10 +8430,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( @@ -7954,10 +8448,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); @@ -7983,13 +8477,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8021,7 +8515,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) { @@ -8038,16 +8532,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; } } @@ -8068,16 +8562,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; } } @@ -8085,15 +8579,15 @@ 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) { 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( @@ -8108,10 +8602,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; } } @@ -8120,10 +8614,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( @@ -8138,10 +8632,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; } } @@ -8149,7 +8643,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) { @@ -8185,8 +8679,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8221,16 +8715,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); @@ -8240,10 +8734,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( @@ -8258,10 +8752,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); @@ -8287,8 +8781,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8323,16 +8817,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); @@ -8342,10 +8836,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( @@ -8360,10 +8854,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); @@ -8389,13 +8883,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8427,7 +8921,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) { @@ -8444,20 +8938,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; } } @@ -8478,20 +8968,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; } } @@ -8499,17 +8985,15 @@ 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) { 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( @@ -8524,12 +9008,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; } } @@ -8538,12 +9020,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( @@ -8558,12 +9038,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; } } @@ -8571,7 +9049,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) { @@ -8607,13 +9085,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8645,7 +9123,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) { @@ -8662,20 +9140,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; } } @@ -8696,20 +9170,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; } } @@ -8717,17 +9187,15 @@ 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) { 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( @@ -8742,12 +9210,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; } } @@ -8756,12 +9222,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( @@ -8776,12 +9240,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; } } @@ -8789,7 +9251,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) { @@ -8825,8 +9287,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -8861,16 +9323,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); @@ -8880,10 +9342,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( @@ -8898,10 +9360,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); @@ -8927,13 +9389,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8963,7 +9425,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( } break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8980,20 +9442,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; } } @@ -9014,36 +9472,30 @@ 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; } } break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { 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( @@ -9058,12 +9510,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; } } @@ -9072,12 +9522,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( @@ -9092,18 +9540,16 @@ 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; } } break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9140,8 +9586,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9176,16 +9622,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); @@ -9195,10 +9641,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( @@ -9213,10 +9659,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); @@ -9242,8 +9688,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9278,16 +9724,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); @@ -9297,10 +9743,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( @@ -9315,10 +9761,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); @@ -9344,13 +9790,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9382,7 +9828,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) { @@ -9399,16 +9845,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; } } @@ -9429,16 +9875,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; } } @@ -9446,15 +9892,15 @@ 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) { 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( @@ -9469,10 +9915,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; } } @@ -9481,10 +9927,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( @@ -9499,10 +9945,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; } } @@ -9510,7 +9956,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) { @@ -9546,8 +9992,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9582,16 +10028,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); @@ -9601,10 +10047,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( @@ -9619,10 +10065,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); @@ -9648,8 +10094,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9684,16 +10130,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); @@ -9703,10 +10149,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( @@ -9721,10 +10167,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); @@ -9750,8 +10196,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9786,16 +10232,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); @@ -9805,10 +10251,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( @@ -9823,10 +10269,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); @@ -9852,8 +10298,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9888,16 +10334,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); @@ -9907,10 +10353,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( @@ -9925,10 +10371,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); @@ -9954,8 +10400,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -9990,16 +10436,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); @@ -10009,10 +10455,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( @@ -10027,10 +10473,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); @@ -10056,8 +10502,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10092,16 +10538,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); @@ -10111,10 +10557,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( @@ -10129,10 +10575,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); @@ -10158,8 +10604,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10194,16 +10640,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); @@ -10213,10 +10659,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( @@ -10231,10 +10677,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); @@ -10260,8 +10706,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10296,16 +10742,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); @@ -10315,10 +10761,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( @@ -10333,10 +10779,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); @@ -10362,8 +10808,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10396,16 +10842,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; @@ -10413,10 +10859,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( @@ -10431,10 +10877,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; @@ -10459,8 +10905,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10493,16 +10939,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; @@ -10510,10 +10956,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( @@ -10528,10 +10974,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; @@ -10556,8 +11002,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10592,16 +11038,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); @@ -10611,10 +11057,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( @@ -10629,10 +11075,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); @@ -10658,8 +11104,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10694,16 +11140,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); @@ -10713,10 +11159,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( @@ -10731,10 +11177,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); @@ -10760,8 +11206,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10796,16 +11242,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); @@ -10815,10 +11261,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( @@ -10833,10 +11279,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); @@ -10862,8 +11308,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10898,16 +11344,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); @@ -10917,10 +11363,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( @@ -10935,10 +11381,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); @@ -10964,8 +11410,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -10977,7 +11423,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( @@ -10990,14 +11436,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( @@ -11010,7 +11456,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) @@ -11036,7 +11482,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( @@ -11049,7 +11495,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( @@ -11062,7 +11508,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( @@ -11075,7 +11521,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) @@ -11095,8 +11541,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11114,14 +11560,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( @@ -11134,14 +11580,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) @@ -11173,7 +11619,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( @@ -11186,7 +11632,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( @@ -11199,14 +11645,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) @@ -11226,8 +11672,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11245,7 +11691,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( @@ -11258,14 +11704,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( @@ -11278,7 +11724,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) @@ -11304,7 +11750,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( @@ -11317,14 +11763,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( @@ -11337,7 +11783,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) @@ -11357,8 +11803,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11376,14 +11822,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( @@ -11396,7 +11842,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( @@ -11409,7 +11855,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) @@ -11441,14 +11887,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( @@ -11461,14 +11907,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) @@ -11488,14 +11934,14 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); + 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); @@ -11503,8 +11949,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11516,7 +11962,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( @@ -11529,14 +11975,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( @@ -11549,7 +11995,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) @@ -11575,7 +12021,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( @@ -11588,7 +12034,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( @@ -11601,7 +12047,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( @@ -11614,7 +12060,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) @@ -11634,8 +12080,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11653,14 +12099,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( @@ -11673,14 +12119,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) @@ -11712,7 +12158,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( @@ -11725,7 +12171,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( @@ -11738,14 +12184,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) @@ -11765,28 +12211,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -11798,7 +12244,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( @@ -11811,21 +12257,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) @@ -11848,7 +12294,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( @@ -11861,7 +12307,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( @@ -11870,7 +12316,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( @@ -11885,7 +12331,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( @@ -11905,7 +12351,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( @@ -11920,7 +12366,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( @@ -11929,7 +12375,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( @@ -11942,7 +12388,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( @@ -11968,7 +12414,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( @@ -11981,7 +12427,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( @@ -11994,7 +12440,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( @@ -12009,7 +12455,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( @@ -12027,7 +12473,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( @@ -12040,7 +12486,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( @@ -12053,7 +12499,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( @@ -12066,7 +12512,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) @@ -12086,8 +12532,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -12099,14 +12545,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( @@ -12119,14 +12565,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) @@ -12157,7 +12603,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( @@ -12166,7 +12612,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( @@ -12179,14 +12625,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( @@ -12210,7 +12656,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( @@ -12219,7 +12665,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( @@ -12234,7 +12680,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( @@ -12243,7 +12689,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( @@ -12275,7 +12721,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( @@ -12288,7 +12734,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( @@ -12301,7 +12747,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( @@ -12310,7 +12756,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( @@ -12334,7 +12780,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( @@ -12347,7 +12793,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( @@ -12360,14 +12806,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) @@ -12387,28 +12833,28 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -12417,28 +12863,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) @@ -12455,8 +12901,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -12465,28 +12911,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) @@ -12503,8 +12949,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -12513,28 +12959,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) @@ -12551,8 +12997,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -12561,28 +13007,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) @@ -12599,44 +13045,42 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { wooden_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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { wooden_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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -12645,7 +13089,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( @@ -12656,7 +13100,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( @@ -12667,14 +13111,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) @@ -12691,8 +13135,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -12701,7 +13145,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( @@ -12712,7 +13156,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( @@ -12723,14 +13167,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) @@ -12747,8 +13191,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -12757,7 +13201,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( @@ -12768,7 +13212,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( @@ -12779,14 +13223,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) @@ -12803,8 +13247,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -12813,7 +13257,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( @@ -12824,7 +13268,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( @@ -12835,14 +13279,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) @@ -12859,44 +13303,44 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -12905,7 +13349,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( @@ -12916,7 +13360,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( @@ -12927,14 +13371,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) @@ -12951,8 +13395,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -12961,7 +13405,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( @@ -12972,7 +13416,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( @@ -12983,14 +13427,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) @@ -13007,8 +13451,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -13017,7 +13461,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( @@ -13028,7 +13472,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( @@ -13039,14 +13483,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) @@ -13063,8 +13507,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -13073,7 +13517,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( @@ -13084,7 +13528,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( @@ -13095,14 +13539,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) @@ -13119,39 +13563,39 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static void wooden_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_G2_WOODEN_RC_BOOSTER_SW_NE, @@ -13168,7 +13612,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 def3934974..c40daa3dca 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -122,8 +122,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_WOODEN_WILD_MOUSE_FLAT_SW_NE, @@ -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, @@ -146,8 +146,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WOODEN_WILD_MOUSE_FLAT_SW_NE, SPR_STATION_BASE_B_SW_NE }, @@ -162,8 +162,8 @@ 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); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + 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); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -171,8 +171,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { { @@ -189,12 +189,11 @@ 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); - 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) { @@ -211,8 +210,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { { @@ -229,7 +228,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) { @@ -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) { @@ -259,8 +257,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { { @@ -277,12 +275,11 @@ 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); - 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) { @@ -299,8 +296,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -317,7 +314,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) { @@ -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) { @@ -350,8 +346,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -368,7 +364,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) { @@ -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) { @@ -402,8 +397,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { { @@ -420,12 +415,11 @@ 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); - 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) { @@ -442,55 +436,55 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][3] = { { @@ -512,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 }; @@ -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; } @@ -547,16 +540,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_1_SW_NE, @@ -570,19 +563,19 @@ 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, 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); + PaintAddImageAsParent(session, imageId, { 0, 6, height }, { 24, 26, 1 }, { 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); + 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); @@ -590,16 +583,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -616,7 +609,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) { @@ -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) { @@ -649,8 +641,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -667,7 +659,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) { @@ -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) { @@ -700,18 +691,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } TRACK_PAINT_FUNCTION get_track_paint_function_wooden_wild_mouse(int32_t trackType) 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/CarRide.cpp b/src/openrct2/ride/gentle/CarRide.cpp index 1113493bf4..2f812e94fb 100644 --- a/src/openrct2/ride/gentle/CarRide.cpp +++ b/src/openrct2/ride/gentle/CarRide.cpp @@ -133,20 +133,32 @@ 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 */ static void paint_car_ride_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -176,8 +188,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -214,8 +226,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -252,8 +264,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -290,32 +302,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -360,7 +372,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, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -368,8 +380,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_3_tiles_paint( session, 3, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -405,18 +417,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_left_quarter_turn_1_tile[direction] | session->TrackColours[SCHEME_TRACK]; @@ -446,16 +457,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -479,7 +490,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); @@ -487,8 +498,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_60_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -536,8 +547,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_25_deg_up_to_60_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -592,8 +603,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_60_deg_up_to_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -648,32 +659,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 ecdf7b25c4..a26a4bd67e 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; @@ -44,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; @@ -53,44 +53,47 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; 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]); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); + 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); - auto ride = get_ride(rideIndex); 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_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 162d6d3ca2..19e14172e3 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -16,23 +16,39 @@ 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 }, + }, + { + // Unused + { 0, 0 }, + { 0, 0 }, + }, + { + { 0, 6 }, + { 24, 42 }, + }, +}; /** * 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); @@ -56,45 +72,47 @@ 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, 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, 127 }, { boundBox.offset, height + 3 }); } static void paint_crooked_house( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; 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]); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); + 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); - auto ride = get_ride(rideIndex); 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 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/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index da07e5e732..5bc9302976 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" @@ -25,68 +26,78 @@ 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) { 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); } static void paint_dodgems( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_4x4[direction][trackSequence]; 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, 30, 30, 1, height, 1, 1, height); - - auto ride = get_ride(rideIndex); + StationObject* stationObject = nullptr; if (ride != nullptr) - { - track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, 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/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index da58c30b44..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" @@ -32,31 +32,28 @@ 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 } }, }; /** * 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; @@ -90,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, boundBox.length_x, boundBox.length_y, 127, height, 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) { @@ -116,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; @@ -134,8 +130,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; @@ -149,52 +145,55 @@ 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]); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); + 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)) + 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); + 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, 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); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 7 }, { 30, 0, height + 2 }); } } 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..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" @@ -33,23 +34,29 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_4x4[direction][trackSequence]; 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 }); + 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 }); + } - auto ride = get_ride(rideIndex); 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 6dea62282e..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] = { @@ -147,32 +159,32 @@ 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; } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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)) @@ -187,8 +199,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -224,18 +236,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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]; @@ -271,8 +283,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -292,10 +304,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); switch (direction) { @@ -303,12 +315,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); @@ -318,19 +328,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); switch ((direction + 2) % 4) { @@ -338,12 +347,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,20 +360,20 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, @@ -392,7 +399,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, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -400,18 +407,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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,30 +448,29 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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( @@ -479,17 +484,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = ghost_train_track_pieces_spinning_tunnel_track[direction] | session->TrackColours[SCHEME_TRACK]; @@ -497,10 +501,10 @@ 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); + 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); @@ -508,14 +512,14 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 33ffc26c6c..cc05ce5b17 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -17,29 +17,26 @@ 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 } }, }; /** * 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; @@ -58,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, boundBox.length_x, boundBox.length_y, 127, height, 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) @@ -83,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; @@ -95,35 +92,38 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; 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]); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); + 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); - auto ride = get_ride(rideIndex); 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 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..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" @@ -45,23 +46,23 @@ enum * rct: 0x004ACF4A */ static void maze_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - uint16_t maze_entry = tileElement->AsTrack()->GetMazeEntry(); - maze_entry = rol16(maze_entry, direction * 4); + uint16_t maze_entry = trackElement.GetMazeEntry(); + maze_entry = Numerics::rol16(maze_entry, direction * 4); uint32_t rotation = session->CurrentRotation; // draw ground 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); 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 90778ee6d2..545b5fb0af 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -16,21 +16,24 @@ #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 */ 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,44 +107,47 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; 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]); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); + 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); - auto ride = get_ride(rideIndex); 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: - 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..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" @@ -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 @@ -451,16 +451,16 @@ 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 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; } @@ -484,8 +484,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -531,8 +531,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -570,8 +570,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -609,8 +609,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -688,15 +687,15 @@ 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]; - 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( - 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]; @@ -711,15 +710,15 @@ 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]; - 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( - 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]; @@ -732,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); @@ -740,8 +739,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -753,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,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static void paint_mini_golf_hole_ab( @@ -833,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); @@ -860,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( @@ -876,36 +875,36 @@ 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 }); } } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { paint_mini_golf_hole_ab(session, trackSequence, direction, height, mini_golf_track_sprites_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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { paint_mini_golf_hole_ab(session, trackSequence, direction, height, mini_golf_track_sprites_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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; 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); @@ -944,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; } @@ -952,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( @@ -962,14 +962,14 @@ 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 }); } } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; CoordsXY boundBox, boundBoxOffset; @@ -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); @@ -1027,7 +1026,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; } @@ -1045,7 +1045,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( @@ -1055,14 +1055,14 @@ 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 }); } } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; CoordsXY boundBox, boundBoxOffset; @@ -1070,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); @@ -1120,7 +1119,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; } @@ -1138,7 +1138,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( @@ -1148,7 +1148,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 }); } } @@ -1235,12 +1235,12 @@ 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; 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 }); } /** @@ -1249,7 +1249,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; } diff --git a/src/openrct2/ride/gentle/MiniHelicopters.cpp b/src/openrct2/ride/gentle/MiniHelicopters.cpp index 8d36ba5e08..2643fab46a 100644 --- a/src/openrct2/ride/gentle/MiniHelicopters.cpp +++ b/src/openrct2/ride/gentle/MiniHelicopters.cpp @@ -18,15 +18,15 @@ /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; 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); @@ -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, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -56,21 +56,21 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; 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); } @@ -88,8 +88,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -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; } @@ -129,8 +129,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -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; } @@ -170,8 +170,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -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; } @@ -211,32 +211,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_3_tiles_paint( session, 3, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -264,22 +264,27 @@ 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_1_tile_paint( session, 1, height, 0, direction, session->TrackColours[SCHEME_TRACK], @@ -293,11 +298,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { paint_mini_helicopters_track_left_quarter_turn_1_tile( - session, rideIndex, 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 677fb5ca80..ecf90721fb 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[2] = { + 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( @@ -153,19 +167,19 @@ 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 */ static void paint_monorail_cycles_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = monorail_cycles_track_pieces_flat[(direction & 1)] | session->TrackColours[SCHEME_TRACK]; paint_monorail_cycles_util_7c( @@ -191,15 +205,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; 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 +225,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); @@ -221,7 +235,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, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -229,8 +243,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_3_tiles_paint( session, 3, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -258,16 +272,21 @@ 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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] = { @@ -286,8 +305,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_5_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -402,18 +421,18 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { @@ -521,8 +540,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 e04c4fc1f7..375d460b17 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; @@ -84,37 +84,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; 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, 32, 32, 1, height, 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); - auto ride = get_ride(rideIndex); 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); } 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); + 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]; - 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); @@ -162,8 +165,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence == 1) { @@ -171,10 +174,10 @@ 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 = 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 2a27d69183..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" @@ -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); @@ -66,7 +67,7 @@ static void paint_space_rings_structure(paint_session* session, Ride* ride, uint } 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) { @@ -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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -100,27 +100,28 @@ 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]); - 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) { 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); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 28, 7 }, { 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); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 1, 7 }, { 0, 29, height + 2 }); } 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 676aebf2cb..6e98da0ee9 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../Track.h" @@ -46,8 +47,8 @@ enum }; static void spiral_slide_paint_tile_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t image_id = 0; @@ -60,12 +61,12 @@ 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t image_id = 0; @@ -78,49 +79,48 @@ 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t image_id = 0; - auto ride = get_ride(rideIndex); if (ride == nullptr) return; 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; @@ -192,37 +192,44 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_2x2[direction][trackSequence]; 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]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 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 }); + } - auto ride = get_ride(rideIndex); 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, rideIndex, trackSequence, direction, height, tileElement); + spiral_slide_paint_tile_right(session, ride, trackSequence, direction, height, trackElement); break; case 2: - spiral_slide_paint_tile_left(session, rideIndex, trackSequence, direction, height, tileElement); + spiral_slide_paint_tile_left(session, ride, trackSequence, direction, height, trackElement); break; case 3: - spiral_slide_paint_tile_front(session, rideIndex, trackSequence, direction, height, tileElement); + spiral_slide_paint_tile_front(session, ride, trackSequence, direction, height, trackElement); break; } 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/Facility.cpp b/src/openrct2/ride/shops/Facility.cpp index b04e644fe3..60ab8b31f5 100644 --- a/src/openrct2/ride/shops/Facility.cpp +++ b/src/openrct2/ride/shops/Facility.cpp @@ -23,13 +23,11 @@ * rct2: 0x007630DE */ static void facility_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + 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]); - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -52,8 +50,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( @@ -63,19 +61,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 c5227d9ed8..d37e6f84fa 100644 --- a/src/openrct2/ride/shops/Shop.cpp +++ b/src/openrct2/ride/shops/Shop.cpp @@ -23,13 +23,11 @@ * rct2: 0x007617A5 */ static void shop_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + 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]); - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -53,13 +51,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/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/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index bd85544280..4abb5b05e9 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; @@ -43,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; @@ -53,44 +53,47 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; 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]); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); + 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); - auto ride = get_ride(rideIndex); 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: - 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 68b6d7a5fe..c89cc39bd0 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 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); @@ -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; @@ -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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -90,53 +89,54 @@ 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]); - 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, + 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 6fbbc33c99..965adb5826 100644 --- a/src/openrct2/ride/thrill/GoKarts.cpp +++ b/src/openrct2/ride/thrill/GoKarts.cpp @@ -125,8 +125,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; if (direction == 0 || direction == 2) @@ -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); @@ -158,8 +158,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; paint_struct* ps; @@ -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; } @@ -212,8 +212,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; paint_struct* ps; @@ -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; } @@ -266,8 +266,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; paint_struct* ps; @@ -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; } @@ -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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** rct2: 0x */ static void paint_go_karts_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -357,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; } @@ -374,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); } @@ -399,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) { @@ -449,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); @@ -457,8 +456,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -519,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); @@ -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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 0b0ca3deac..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 @@ -44,11 +41,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()) @@ -87,38 +84,41 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; 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, 32, 32, 1, height, 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); - auto ride = get_ride(rideIndex); if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, - launched_freefall_fence_sprites, session->CurrentRotation); + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_TRACK], height, + fenceSpritesMetal, session->CurrentRotation); } 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); + 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; 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); @@ -163,8 +163,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence == 1) { @@ -172,10 +172,10 @@ 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 = 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 4300046f08..8481ea262d 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" @@ -42,20 +43,25 @@ 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 Vehicle* get_first_vehicle(Ride* ride) +static const Vehicle* get_first_vehicle(const Ride* ride) { if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) { @@ -84,9 +90,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), bbSize.x, bbSize.y, 127, offset.z, - bbOffset.x, bbOffset.y, bbOffset.z); + PaintAddImageAsParent(session, imageId, offset, { bbSize.x, bbSize.y, 127 }, bbOffset); } else { @@ -120,8 +124,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 +163,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 +182,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,8 +219,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; @@ -239,13 +243,18 @@ 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, 32, 32, 1, height); + 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; } - 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 ac687f3e22..0d80da8ad9 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 TrackElement& trackElement) { - auto ride = get_ride(tileElement->AsTrack()->GetRideIndex()); if (ride == nullptr) return; @@ -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); @@ -132,34 +140,38 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_2x2[direction][trackSequence]; 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); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); + + 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); - auto ride = get_ride(rideIndex); 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, 16, -16, direction, height, tileElement); + paint_motionsimulator_vehicle(session, ride, 16, -16, direction, height, trackElement); break; case 2: - paint_motionsimulator_vehicle(session, -16, 16, direction, height, tileElement); + paint_motionsimulator_vehicle(session, ride, -16, 16, direction, height, trackElement); break; case 3: - paint_motionsimulator_vehicle(session, -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 e2fc9ada3e..e2a7f15dd3 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()) { @@ -97,39 +97,42 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; 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, 32, 32, 1, height, 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); - auto ride = get_ride(rideIndex); 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); } 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, 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); @@ -178,8 +181,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence == 1) { @@ -187,10 +190,10 @@ 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 = 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 b684c0b212..bcbdb97980 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" @@ -16,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 { @@ -31,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 @@ -42,25 +56,30 @@ 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, 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); + if (rideEntry == nullptr) + return; + 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; @@ -91,7 +110,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]; @@ -101,8 +120,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 +129,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); @@ -123,12 +142,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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,46 +165,48 @@ 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, 32, 32, 1, height); - - 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, 32, 8, 1, height + 9); - break; - case 1: - imageId = SPR_STATION_PLATFORM_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 24, 0, 8, 32, 1, height + 9); - 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; + } } } - auto ride = get_ride(rideIndex); if (ride != nullptr) { 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; } } diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index 675f4e446c..f57d67cac5 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" @@ -32,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[] = { @@ -57,7 +63,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; @@ -113,8 +119,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( @@ -173,10 +179,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -185,120 +190,136 @@ 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], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } else if (direction & 1) { 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, 32, 32, 1, height); + 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, 32, 32, 1, height); + 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, tileElement, 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, 8, 32, 1, height + 9); - - hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, tileElement, 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]; - PaintAddImageAsParent(session, imageId, 31, 0, 1, 32, 7, height + 11); + 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, 23, 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, height + 11 }, { 1, 32, 7 }); } - - imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 31, 8, 1, 7, height + 11); - } - else if (hasFence) - { - imageId = SPR_STATION_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 31, 0, 1, 32, 7, height + 11); } } - } - else - { - if (relativeTrackSequence != 1 && relativeTrackSequence != 4) + else { - hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, 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, 32, 8, 1, height + 9); - - hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, tileElement, 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]; - PaintAddImageAsParent(session, imageId, 0, 31, 32, 1, 7, height + 11); + imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_SW_NE : SPR_STATION_PLATFORM_BEGIN_SW_NE) + | session->TrackColours[SCHEME_TRACK]; } else { - imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 31, 23, 1, 8, 7, height + 11); + 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 = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 31, 0, 1, 8, 7, height + 11); - } - else if (hasFence) - { - imageId = SPR_STATION_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 31, 32, 1, 7, height + 11); + 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 }); + } } } } - switch (relativeTrackSequence) { case 1: diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 3487207786..7c8851fb4a 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -43,15 +43,14 @@ 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, - const TileElement* tileElement) + paint_session* session, int32_t al, int32_t cl, const Ride* ride, uint8_t direction, int32_t height, + const TrackElement& tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; - uint16_t boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ; - // As we will be drawing a vehicle we need to backup the tileElement that + 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); @@ -75,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) @@ -248,44 +245,47 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; 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]); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); + 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); - auto ride = get_ride(rideIndex); 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, rideIndex, direction, height, tileElement); + top_spin_paint_vehicle(session, 32, 32, ride, direction, height, trackElement); break; case 3: - top_spin_paint_vehicle(session, 32, -32, rideIndex, direction, height, tileElement); + top_spin_paint_vehicle(session, 32, -32, ride, direction, height, trackElement); break; case 5: - top_spin_paint_vehicle(session, 0, -32, rideIndex, direction, height, tileElement); + top_spin_paint_vehicle(session, 0, -32, ride, direction, height, trackElement); break; case 6: - top_spin_paint_vehicle(session, -32, 32, rideIndex, direction, height, tileElement); + top_spin_paint_vehicle(session, -32, 32, ride, direction, height, trackElement); break; case 7: - top_spin_paint_vehicle(session, -32, -32, rideIndex, direction, height, tileElement); + top_spin_paint_vehicle(session, -32, -32, ride, direction, height, trackElement); break; case 8: - top_spin_paint_vehicle(session, -32, 0, rideIndex, 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 1c0d26192c..4422b484ce 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); @@ -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; @@ -79,10 +80,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -92,27 +92,28 @@ 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]); - 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) { 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); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 28, 7 }, { 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); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 1, 7 }, { 0, 29, height + 3 }); } 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/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/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index ce5e9f9083..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) { @@ -107,10 +111,10 @@ 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) +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; @@ -120,75 +124,74 @@ 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->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( - ride_id_t rideIndex, 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, rideIndex); + 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( - ride_id_t rideIndex, 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, rideIndex); + 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - auto ride = get_ride(rideIndex); 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(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, trackElement, pos, trackType); + bool isEnd = chairlift_paint_util_is_last_track(ride, trackElement, pos, trackType); 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) { @@ -199,7 +202,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]; @@ -213,7 +216,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,23 +269,22 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - auto ride = get_ride(rideIndex); 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(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, trackElement, pos, trackType); + bool isEnd = chairlift_paint_util_is_last_track(ride, trackElement, pos, trackType); 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) { @@ -293,7 +295,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]; @@ -307,7 +309,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]; @@ -362,22 +364,22 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (direction % 2) { - chairlift_paint_station_se_nw(session, rideIndex, trackSequence, direction, height, tileElement); + chairlift_paint_station_se_nw(session, ride, trackSequence, direction, height, trackElement); } else { - chairlift_paint_station_ne_sw(session, rideIndex, trackSequence, direction, height, tileElement); + chairlift_paint_station_ne_sw(session, ride, trackSequence, direction, height, trackElement); } } static void chairlift_paint_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; if (direction & 1) @@ -399,8 +401,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -437,8 +439,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -492,8 +494,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -547,32 +549,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -638,10 +640,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /* 0x008AAA0C */ diff --git a/src/openrct2/ride/transport/Lift.cpp b/src/openrct2/ride/transport/Lift.cpp index d4c335600e..a246809f4a 100644 --- a/src/openrct2/ride/transport/Lift.cpp +++ b/src/openrct2/ride/transport/Lift.cpp @@ -39,16 +39,16 @@ 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 */ static void paint_lift_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -75,13 +75,12 @@ 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 }); - auto ride = get_ride(rideIndex); 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,8 +119,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (trackSequence == 1) { diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index 9d42a0a9fc..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] = { @@ -558,7 +578,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; } @@ -572,14 +592,30 @@ 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]; } @@ -588,20 +624,19 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bool paintAsGravel = false; bool paintGrooved = false; - if (session->PathElementOnSameHeight) + if (session->PathElementOnSameHeight != nullptr) { paintAsGravel = true; 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 @@ -668,12 +703,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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); @@ -683,7 +718,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, trackElement); // covers shouldn't be offset by +2 paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -692,8 +727,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = miniature_railway_track_pieces_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -715,8 +750,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); @@ -724,8 +758,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = miniature_railway_track_pieces_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -747,8 +781,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); @@ -756,8 +789,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = miniature_railway_track_pieces_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -779,8 +812,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); @@ -788,146 +820,173 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (right_quarter_turn_5_supports_type[direction][trackSequence] != -1) { 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)) { @@ -1009,32 +1068,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } 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 */ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { @@ -1042,8 +1109,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 }, @@ -1120,23 +1186,31 @@ 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 */ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { @@ -1144,8 +1218,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 }, @@ -1241,41 +1314,43 @@ 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bool isSupported = false; if (trackSequence != 1 && trackSequence != 2) { 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) { @@ -1288,7 +1363,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 @@ -1333,23 +1408,47 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, 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] = { @@ -1416,19 +1515,24 @@ 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, - const TileElement* tileElement) + 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 = 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) { 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) @@ -1444,8 +1548,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, bounds.x, bounds.y, static_cast(bounds.z), height, offset.x, offset.y, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); } } else @@ -1454,8 +1557,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, bounds.x, bounds.y, static_cast(bounds.z), height, 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) @@ -1481,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] = { @@ -1554,19 +1677,24 @@ 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, - const TileElement* tileElement) + 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 = 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) { 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; @@ -1584,8 +1712,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, bounds.x, bounds.y, static_cast(bounds.z), height, offset.x, offset.y, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); } } else @@ -1594,8 +1721,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, bounds.x, bounds.y, static_cast(bounds.z), height, 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) @@ -1623,22 +1749,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } static constexpr const bool miniature_railway_diag_image_segment[][4] = { @@ -1683,8 +1807,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bool isSupported = false; int16_t supportType = monorail_diag_support_types[direction][trackSequence]; @@ -1698,8 +1822,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) @@ -1713,8 +1836,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, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); if (drawRail) { PaintAddImageAsChild( @@ -1725,7 +1848,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); @@ -1739,16 +1862,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; @@ -1756,8 +1878,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { // TODO: The supports are inconsistent for different rotations @@ -1768,7 +1890,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) { @@ -1787,7 +1909,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) @@ -1799,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]; @@ -1808,9 +1935,9 @@ 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, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -1821,8 +1948,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); @@ -1831,8 +1958,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bool hasSupports = false; @@ -1846,8 +1973,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) @@ -1861,8 +1987,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, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); if (drawRail) { PaintAddImageAsChild( @@ -1873,7 +1999,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); @@ -1882,10 +2008,10 @@ 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, - const TileElement* tileElement) + 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 }, @@ -1912,7 +2038,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) @@ -1920,7 +2046,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 } }, @@ -1930,14 +2056,14 @@ 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) { 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, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -1948,8 +2074,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); @@ -1958,10 +2084,10 @@ 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, - const TileElement* tileElement) + 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 }, @@ -1988,7 +2114,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) @@ -1998,9 +2124,9 @@ 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 }; - 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 } }, @@ -2010,9 +2136,9 @@ 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, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2023,8 +2149,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); @@ -2033,10 +2159,10 @@ 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, - const TileElement* tileElement) + 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 }, @@ -2062,7 +2188,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) @@ -2070,7 +2196,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 } }, @@ -2079,14 +2205,14 @@ 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) { 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, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2097,8 +2223,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); @@ -2106,8 +2232,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { bool hasSupports = false; uint32_t floorImage = 0; @@ -2120,8 +2246,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) @@ -2135,8 +2260,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, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); if (drawRail) { PaintAddImageAsChild( @@ -2147,7 +2272,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 eccd89fa0f..6cc63a6a11 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" @@ -166,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] = { @@ -190,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] = { @@ -419,8 +436,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = monorail_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -454,20 +471,27 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; + const StationObject* stationObject = nullptr; - if (direction == 0 || direction == 2) + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + 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, 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, height - 2 }, { 28, 32, 2 }, { 2, 0, height }); + } } imageId = monorail_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -500,7 +524,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, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -508,8 +532,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = monorail_track_pieces_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -550,8 +574,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = monorail_track_pieces_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -592,8 +616,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = monorail_track_pieces_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -634,32 +658,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_5_tiles_paint( session, 3, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -721,32 +745,31 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { 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 }, @@ -758,13 +781,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) @@ -837,22 +858,22 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { 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 }, @@ -864,13 +885,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) @@ -943,8 +962,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_3_tiles_paint( session, 3, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -980,20 +999,21 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { int8_t index = paint_monorail_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1001,7 +1021,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) @@ -1060,8 +1080,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { int8_t index = paint_monorail_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1069,7 +1089,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) @@ -1128,22 +1148,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, - const TileElement* tileElement) + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + 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, rideIndex, 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] = { @@ -1153,22 +1173,29 @@ 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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) @@ -1185,13 +1212,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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) @@ -1208,13 +1235,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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) @@ -1231,13 +1258,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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) @@ -1254,13 +1281,13 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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) @@ -1277,14 +1304,14 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) { 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) @@ -1301,14 +1328,14 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) { 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/transport/SuspendedMonorail.cpp b/src/openrct2/ride/transport/SuspendedMonorail.cpp index 24b340f232..558fd8690f 100644 --- a/src/openrct2/ride/transport/SuspendedMonorail.cpp +++ b/src/openrct2/ride/transport/SuspendedMonorail.cpp @@ -21,8 +21,8 @@ /** rct2: 0x008636F4 */ static void suspended_monorail_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -53,8 +53,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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); @@ -80,8 +80,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -145,8 +145,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -210,8 +210,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -275,32 +275,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -479,17 +479,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -659,8 +659,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -830,8 +830,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -949,17 +949,17 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1121,8 +1121,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1284,26 +1284,26 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1385,8 +1385,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1468,8 +1468,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1551,8 +1551,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1634,8 +1634,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1717,8 +1717,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { @@ -1797,8 +1797,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (trackSequence) { 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/BoatHire.cpp b/src/openrct2/ride/water/BoatHire.cpp index c8c9e3e141..2356167ad6 100644 --- a/src/openrct2/ride/water/BoatHire.cpp +++ b/src/openrct2/ride/water/BoatHire.cpp @@ -31,8 +31,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -74,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,8 +88,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; const auto offset = CoordsXYZ{ 0, 0, height }; @@ -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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } /** diff --git a/src/openrct2/ride/water/DingySlide.cpp b/src/openrct2/ride/water/DingySlide.cpp index 6695bdb73e..dd16a364a4 100644 --- a/src/openrct2/ride/water/DingySlide.cpp +++ b/src/openrct2/ride/water/DingySlide.cpp @@ -349,8 +349,8 @@ enum }; static void dinghy_slide_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -387,8 +387,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -417,8 +417,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -462,8 +462,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -498,8 +498,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -543,8 +543,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -579,8 +579,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -615,8 +615,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -660,43 +660,43 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static void dinghy_slide_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][5] = { { @@ -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( @@ -823,41 +823,49 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static void dinghy_slide_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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]; @@ -933,26 +941,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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]; @@ -1026,8 +1042,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][3] = { { @@ -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( @@ -1107,16 +1123,16 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } static void dinghy_slide_track_flat_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -1144,8 +1160,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -1180,8 +1196,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -1216,8 +1232,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -1252,8 +1268,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -1288,8 +1304,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -1324,8 +1340,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -1360,44 +1376,43 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][5] = { { @@ -1427,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] = { { @@ -1457,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( @@ -1524,35 +1539,42 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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]; @@ -1628,26 +1650,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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]; @@ -1721,8 +1751,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][3] = { { @@ -1744,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] = { { @@ -1766,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( @@ -1802,20 +1832,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, 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 12cdfffb84..2fe8f9d951 100644 --- a/src/openrct2/ride/water/LogFlume.cpp +++ b/src/openrct2/ride/water/LogFlume.cpp @@ -161,8 +161,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = LogFlumeTrackFlatImageIds[direction][0] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = LogFlumeTrackFlatImageIds[direction][1] | session->TrackColours[SCHEME_TRACK]; @@ -182,8 +182,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + 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); @@ -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) { @@ -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, trackElement); // Covers shouldn't be offset by +2 paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -219,8 +219,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -254,8 +254,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -289,8 +289,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -324,8 +324,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -359,8 +359,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -394,8 +394,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -429,26 +429,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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]; @@ -524,26 +532,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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]; @@ -617,8 +633,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -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( @@ -684,8 +712,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 }, @@ -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( @@ -751,11 +791,11 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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) { @@ -774,7 +814,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); @@ -782,8 +822,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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 b2b215d6f3..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 @@ -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()) { @@ -276,8 +277,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -302,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) { @@ -319,13 +320,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); 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, trackElement); paint_util_set_general_support_height(session, height + 32, 0x20); } @@ -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; } @@ -508,40 +508,40 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { paint_river_rapids_track_25_deg(session, direction, height, river_rapids_track_pieces_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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { paint_river_rapids_track_25_deg_to_flat_b(session, direction, height, river_rapids_track_pieces_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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { paint_river_rapids_track_25_deg_to_flat_a(session, direction, height, river_rapids_track_pieces_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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { paint_river_rapids_track_25_deg(session, (direction + 2) % 4, height, river_rapids_track_pieces_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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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,8 +549,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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,8 +558,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; switch (direction) @@ -607,15 +607,15 @@ 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); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -664,19 +664,19 @@ 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); } /** 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; - uint16_t frameNum = (gScenarioTicks / 2) & 7; + uint16_t frameNum = (gCurrentTicks / 2) & 7; if (direction & 1) { @@ -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) { @@ -734,12 +734,12 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; - uint16_t frameNum = (gScenarioTicks / 2) & 7; + uint16_t frameNum = (gCurrentTicks / 2) & 7; 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) { @@ -775,22 +775,22 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - paint_river_rapids_track_flat(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; - uint8_t frameNum = (gScenarioTicks / 4) % 16; + uint8_t frameNum = (gCurrentTicks / 4) % 16; 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 8d693895d4..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,12 +472,12 @@ 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( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = SplashBoats25DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats25DegUpFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -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) { @@ -501,8 +500,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = SplashBoats60DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats60DegUpFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -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) { @@ -527,8 +525,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = SplashBoatsFlatTo25DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoatsFlatTo25DegUpFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -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) { @@ -552,8 +549,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = SplashBoats25DegUpToFlatImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats25DegUpToFlatFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -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) { @@ -577,8 +573,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = SplashBoats25DegUpTo60DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats25DegUpTo60DegUpFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -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) { @@ -603,8 +598,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = SplashBoats60DegUpTo25DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats60DegUpTo25DegUpFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -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) { @@ -629,8 +623,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = SplashBoats25DegDownImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats25DegDownFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -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) { @@ -655,15 +649,15 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = SplashBoatsFlatTo25DegDownImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoatsFlatTo25DegDownFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -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) { @@ -688,24 +682,22 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId = SplashBoats25DegDownToFlatImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats25DegDownToFlatFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -715,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) { @@ -742,8 +734,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { uint32_t imageId; @@ -751,24 +743,24 @@ 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); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction & 1) { @@ -785,33 +777,32 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { if (direction & 1) { 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, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } else { 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, 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); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); - 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, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -821,8 +812,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_5_tiles_paint_2( session, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], RiverRaftsLeftQuarterTurn5_Top); @@ -838,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) @@ -902,8 +893,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_5_tiles_paint_2( session, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], RiverRaftsRightQuarterTurn5_Top); @@ -919,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) @@ -983,26 +974,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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]; @@ -1016,7 +1015,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: @@ -1024,8 +1023,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, @@ -1038,8 +1036,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, @@ -1050,7 +1047,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; } @@ -1075,26 +1072,34 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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]; @@ -1108,7 +1113,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: @@ -1116,8 +1121,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, @@ -1130,8 +1134,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, @@ -1142,7 +1145,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; } @@ -1166,8 +1169,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { switch (direction) { @@ -1185,9 +1188,9 @@ 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, 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 ad97018f6c..2b3cbdd52a 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; @@ -81,10 +82,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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -95,20 +95,20 @@ 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( - session, ride, stationObj, session->MapPosition, direction, height, tileElement, session->CurrentRotation); + session, ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); } 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( - 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,8 +116,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { int32_t heightLower = height - 16; uint32_t imageId; @@ -125,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); } @@ -148,8 +148,8 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_3_tiles_paint( session, 3, height - 16, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -179,19 +179,24 @@ 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_1_tile_paint( session, 1, height - 16, 0, direction, session->TrackColours[SCHEME_TRACK], @@ -204,11 +209,11 @@ 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { submarine_ride_paint_track_left_quarter_turn_1_tile( - session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + 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 0796783d47..166de550c1 100644 --- a/src/openrct2/ride/water/WaterCoaster.cpp +++ b/src/openrct2/ride/water/WaterCoaster.cpp @@ -13,309 +13,316 @@ #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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_flat_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } static void water_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_up_to_flat( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - junior_rc_paint_station(session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { junior_rc_paint_track_25_deg_up_to_60_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { junior_rc_paint_track_60_deg_up_to_25_deg_up( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { - 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, trackElement); } // 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, - tileElement); + session, ride, water_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 1) % 4, height, + trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, - tileElement); + session, ride, water_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 3) % 4, height, + trackElement); } // 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + 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, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { junior_rc_paint_track_diag_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { junior_rc_paint_track_diag_60_deg_down( - session, rideIndex, 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, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, 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, - const TileElement* tileElement) + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) { 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, trackElement, JuniorRcChainType::None); } TRACK_PAINT_FUNCTION get_track_paint_function_water_rc(int32_t trackType) 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( diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index f8ebac8c36..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" @@ -58,7 +59,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; @@ -68,15 +69,14 @@ bool gFirstTimeSaving = true; uint16_t gSavedAge; uint32_t gLastAutoSaveUpdate = 0; -uint32_t gScenarioTicks; random_engine_t gScenarioRand; Objective gScenarioObjective; bool gAllowEarlyCompletionInNetworkPlay; uint16_t gScenarioParkRatingWarningDays; -money32 gScenarioCompletedCompanyValue; -money32 gScenarioCompanyValueRecord; +money64 gScenarioCompletedCompanyValue; +money64 gScenarioCompanyValueRecord; char gScenarioFileName[MAX_PATH]; @@ -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)) @@ -144,7 +141,7 @@ void scenario_begin() gCurrentProfit = 0; gWeeklyProfitAverageDividend = 0; gWeeklyProfitAverageDivisor = 0; - gScenarioCompletedCompanyValue = MONEY32_UNDEFINED; + gScenarioCompletedCompanyValue = MONEY64_UNDEFINED; gTotalAdmissions = 0; gTotalIncomeFromAdmissions = 0; gScenarioCompletedBy = "?"; @@ -197,7 +194,7 @@ void scenario_failure() */ void scenario_success() { - const money32 companyValue = gCompanyValue; + auto companyValue = gCompanyValue; gScenarioCompletedCompanyValue = companyValue; peep_applause(); @@ -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()) { @@ -613,106 +598,10 @@ 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 { - int16_t parkRating = gParkRating; - int32_t currentMonthYear = gDateMonthsElapsed; + auto parkRating = gParkRating; + auto currentMonthYear = gDateMonthsElapsed; if (currentMonthYear == MONTH_COUNT * Year || AllowEarlyCompletion()) { @@ -720,7 +609,8 @@ ObjectiveStatus Objective::CheckGuestsBy() const { return ObjectiveStatus::Success; } - else if (currentMonthYear == MONTH_COUNT * Year) + + if (currentMonthYear == MONTH_COUNT * Year) { return ObjectiveStatus::Failure; } @@ -741,7 +631,8 @@ ObjectiveStatus Objective::CheckParkValueBy() const { return ObjectiveStatus::Success; } - else if (currentMonthYear == MONTH_COUNT * Year) + + if (currentMonthYear == MONTH_COUNT * Year) { return ObjectiveStatus::Failure; } @@ -928,8 +819,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 +869,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..50f3b43af2 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -7,16 +7,13 @@ * 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" #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" @@ -27,281 +24,6 @@ using random_engine_t = Random::Rct2::Engine; -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 -{ - 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); - -// 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; - uint32_t 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 { SCENARIO_FLAGS_VISIBLE = (1 << 0), @@ -373,7 +95,7 @@ struct Objective }; union { - money32 Currency; + money64 Currency; uint16_t MinimumExcitement; // For the "Finish 5 coaster with a minimum excitement rating" objective. }; @@ -423,20 +145,19 @@ 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]; -extern uint32_t gScenarioTicks; 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 SCENARIO_CATEGORY gScenarioCategory; extern std::string gScenarioName; extern std::string gScenarioDetails; extern std::string gScenarioCompletedBy; @@ -461,11 +182,7 @@ 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); void scenario_autosave_check(); - -#endif diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 9f9aefcd48..a2aa515876 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" @@ -50,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) @@ -96,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); } @@ -153,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 @@ -223,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&) { @@ -318,7 +308,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 +406,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. @@ -526,7 +516,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()); @@ -598,7 +588,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 +602,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 +774,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..c9ff1e12c7 100644 --- a/src/openrct2/scenario/ScenarioRepository.h +++ b/src/openrct2/scenario/ScenarioRepository.h @@ -20,10 +20,22 @@ struct scenario_highscore_entry { utf8* fileName; utf8* name; - money32 company_value; + money64 company_value; 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]; @@ -38,7 +50,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,14 +83,16 @@ 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); -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, money32 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/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 diff --git a/src/openrct2/scripting/Duktape.hpp b/src/openrct2/scripting/Duktape.hpp index fdd7f0f327..4f3881dc75 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" @@ -122,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(); @@ -221,42 +229,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*) { @@ -271,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); @@ -314,6 +285,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()); @@ -362,18 +339,16 @@ namespace OpenRCT2::Scripting template<> inline DukValue ToDuk(duk_context* ctx, const CoordsXYZ& value) { - if (value.isNull()) + if (value.IsNull()) { 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) @@ -387,26 +362,24 @@ 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); } - 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) @@ -429,7 +402,7 @@ namespace OpenRCT2::Scripting } else { - result.setNull(); + result.SetNull(); } return result; } diff --git a/src/openrct2/scripting/HookEngine.cpp b/src/openrct2/scripting/HookEngine.cpp index 266c7050d2..6c2a750348 100644 --- a/src/openrct2/scripting/HookEngine.cpp +++ b/src/openrct2/scripting/HookEngine.cpp @@ -11,29 +11,32 @@ # 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 }, + { "vehicle.crash", HOOK_TYPE::VEHICLE_CRASH }, +}); + 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) 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/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 deleted file mode 100644 index f1b581206d..0000000000 --- a/src/openrct2/scripting/ScEntity.hpp +++ /dev/null @@ -1,1239 +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 - -#ifdef ENABLE_SCRIPTING - -# include "../Context.h" -# include "../common.h" -# include "../peep/Peep.h" -# include "../peep/Staff.h" -# include "../util/Util.h" -# include "../world/EntityList.h" -# include "../world/Sprite.h" -# include "Duktape.hpp" -# include "ScRide.hpp" -# include "ScriptEngine.h" - -# include -# include -# include - -namespace OpenRCT2::Scripting -{ - class ScEntity - { - protected: - uint16_t _id = SPRITE_INDEX_NULL; - - public: - ScEntity(uint16_t id) - : _id(id) - { - } - - private: - int32_t id_get() const - { - auto entity = GetEntity(); - return entity != nullptr ? entity->sprite_index : 0; - } - - std::string type_get() const - { - auto entity = GetEntity(); - if (entity != nullptr) - { - switch (entity->Type) - { - case EntityType::Vehicle: - return "car"; - case EntityType::Guest: - case EntityType::Staff: - return "peep"; - case EntityType::SteamParticle: - return "steam_particle"; - case EntityType::MoneyEffect: - return "money_effect"; - case EntityType::CrashedVehicleParticle: - return "crashed_vehicle_particle"; - case EntityType::ExplosionCloud: - return "explosion_cloud"; - case EntityType::CrashSplash: - return "crash_splash"; - case EntityType::ExplosionFlare: - return "explosion_flare"; - case EntityType::Balloon: - return "balloon"; - case EntityType::Duck: - return "duck"; - case EntityType::JumpingFountain: - return "jumping_fountain"; - case EntityType::Litter: - return "litter"; - case EntityType::Null: - return "unknown"; - default: - break; - } - } - return "unknown"; - } - - // x getter and setter - int32_t x_get() const - { - auto entity = GetEntity(); - return entity != nullptr ? entity->x : 0; - } - void x_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto entity = GetEntity(); - if (entity != nullptr) - { - entity->MoveTo({ value, entity->y, entity->z }); - } - } - - // y getter and setter - int32_t y_get() const - { - auto entity = GetEntity(); - return entity != nullptr ? entity->y : 0; - } - void y_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto entity = GetEntity(); - if (entity != nullptr) - { - entity->MoveTo({ entity->x, value, entity->z }); - } - } - - // z getter and setter - int16_t z_get() const - { - auto entity = GetEntity(); - return entity != nullptr ? entity->z : 0; - } - void z_set(int16_t value) - { - ThrowIfGameStateNotMutable(); - auto entity = GetEntity(); - if (entity != nullptr) - { - entity->MoveTo({ entity->x, entity->y, value }); - } - } - - void remove() - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto entity = GetEntity(); - if (entity != nullptr) - { - entity->Invalidate(); - switch (entity->Type) - { - case EntityType::Vehicle: - duk_error(ctx, DUK_ERR_ERROR, "Removing a vehicle is currently unsupported."); - break; - case EntityType::Guest: - case EntityType::Staff: - { - auto peep = entity->As(); - // We can't remove a single peep from a ride at the moment as this can cause complications with the - // vehicle car having an unsupported peep capacity. - if (peep == nullptr || peep->State == PeepState::OnRide || peep->State == PeepState::EnteringRide) - { - duk_error(ctx, DUK_ERR_ERROR, "Removing a peep that is on a ride is currently unsupported."); - } - else - { - peep->Remove(); - } - break; - } - case EntityType::SteamParticle: - case EntityType::MoneyEffect: - case EntityType::CrashedVehicleParticle: - case EntityType::ExplosionCloud: - case EntityType::CrashSplash: - case EntityType::ExplosionFlare: - case EntityType::JumpingFountain: - case EntityType::Balloon: - case EntityType::Duck: - case EntityType::Litter: - sprite_remove(entity); - break; - case EntityType::Null: - break; - default: - break; - } - } - } - - SpriteBase* GetEntity() const - { - return ::GetEntity(_id); - } - - public: - static void Register(duk_context* ctx) - { - dukglue_register_property(ctx, &ScEntity::id_get, nullptr, "id"); - dukglue_register_property(ctx, &ScEntity::type_get, nullptr, "type"); - dukglue_register_property(ctx, &ScEntity::x_get, &ScEntity::x_set, "x"); - dukglue_register_property(ctx, &ScEntity::y_get, &ScEntity::y_set, "y"); - dukglue_register_property(ctx, &ScEntity::z_get, &ScEntity::z_set, "z"); - dukglue_register_method(ctx, &ScEntity::remove, "remove"); - } - }; - - 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::peeps_get, nullptr, "peeps"); - 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 peeps_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 }, - { "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"); - } - - 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); - } - } - }; - - 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; - } - } - }; - -} // namespace OpenRCT2::Scripting - -#endif diff --git a/src/openrct2/scripting/ScMap.hpp b/src/openrct2/scripting/ScMap.hpp deleted file mode 100644 index a86423cf63..0000000000 --- a/src/openrct2/scripting/ScMap.hpp +++ /dev/null @@ -1,189 +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 - -#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/Map.h" -# include "Duktape.hpp" -# include "ScEntity.hpp" -# include "ScRide.hpp" -# include "ScTile.hpp" - -namespace OpenRCT2::Scripting -{ - class ScMap - { - private: - duk_context* _context; - - public: - ScMap(duk_context* ctx) - : _context(ctx) - { - } - - 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); - } - - int32_t numRides_get() const - { - return static_cast(GetRideManager().size()); - } - - int32_t numEntities_get() const - { - return MAX_ENTITIES; - } - - 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::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 getTile(int32_t x, int32_t y) const - { - auto coords = TileCoordsXY(x, y).ToCoordsXY(); - return std::make_shared(coords); - } - - 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); - } - - 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))); - } - } - 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 - { - duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); - } - - return result; - } - - 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"); - } - - 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)); - default: - return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - } - } - }; -} // namespace OpenRCT2::Scripting - -#endif diff --git a/src/openrct2/scripting/ScNetwork.hpp b/src/openrct2/scripting/ScNetwork.hpp deleted file mode 100644 index ae8ddec4b1..0000000000 --- a/src/openrct2/scripting/ScNetwork.hpp +++ /dev/null @@ -1,540 +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 - -#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" - -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: - 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: -# ifdef __clang__ - [[maybe_unused]] -# endif - duk_context* _context; - - public: - ScNetwork(duk_context* ctx) - : _context(ctx) - { - } - - 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(); -# else - return 0; -# endif - } - int32_t numGroups_get() const - { -# ifndef DISABLE_NETWORK - return network_get_num_groups(); -# 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."); - } -# 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"); - } - }; -} // namespace OpenRCT2::Scripting - -#endif diff --git a/src/openrct2/scripting/ScPark.hpp b/src/openrct2/scripting/ScPark.hpp deleted file mode 100644 index ba0b65a1e0..0000000000 --- a/src/openrct2/scripting/ScPark.hpp +++ /dev/null @@ -1,610 +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 - -#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 - -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 }, - { "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: - money32 cash_get() const - { - return gCash; - } - void cash_set(money32 value) - { - ThrowIfGameStateNotMutable(); - - if (gCash != value) - { - gCash = value; - auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); - } - } - - int32_t rating_get() const - { - return gParkRating; - } - void 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); - } - } - - money32 bankLoan_get() const - { - return gBankLoan; - } - void bankLoan_set(money32 value) - { - ThrowIfGameStateNotMutable(); - - if (gBankLoan != value) - { - gBankLoan = value; - auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); - } - } - - money32 maxBankLoan_get() const - { - return gMaxBankLoan; - } - void maxBankLoan_set(money32 value) - { - ThrowIfGameStateNotMutable(); - - if (gMaxBankLoan != value) - { - gMaxBankLoan = value; - auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); - } - } - - money16 entranceFee_get() const - { - return gParkEntranceFee; - } - void entranceFee_set(money16 value) - { - ThrowIfGameStateNotMutable(); - - if (gParkEntranceFee != value) - { - gParkEntranceFee = value; - window_invalidate_by_class(WC_PARK_INFORMATION); - } - } - - uint32_t guests_get() const - { - return gNumGuestsInPark; - } - - uint32_t suggestedGuestMaximum_get() const - { - return _suggestedGuestMaximum; - } - - int32_t guestGenerationProbability_get() const - { - return _guestGenerationProbability; - } - - money16 guestInitialCash_get() const - { - return gGuestInitialCash; - } - - uint8_t guestInitialHappiness_get() const - { - return gGuestInitialHappiness; - } - - uint8_t guestInitialHunger_get() const - { - return gGuestInitialHunger; - } - - uint8_t guestInitialThirst_get() const - { - return gGuestInitialThirst; - } - - money32 value_get() const - { - return gParkValue; - } - void value_set(money32 value) - { - ThrowIfGameStateNotMutable(); - - if (gParkValue != value) - { - gParkValue = value; - auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); - } - } - - money32 companyValue_get() const - { - return gCompanyValue; - } - void companyValue_set(money32 value) - { - ThrowIfGameStateNotMutable(); - - if (gCompanyValue != value) - { - gCompanyValue = value; - auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); - } - } - - money16 totalRideValueForMoney_get() const - { - return gTotalRideValueForMoney; - } - - uint32_t totalAdmissions_get() const - { - return gTotalAdmissions; - } - void totalAdmissions_set(uint32_t value) - { - ThrowIfGameStateNotMutable(); - - if (gTotalAdmissions != value) - { - gTotalAdmissions = value; - window_invalidate_by_class(WC_PARK_INFORMATION); - } - } - - money32 totalIncomeFromAdmissions_get() const - { - return gTotalIncomeFromAdmissions; - } - void totalIncomeFromAdmissions_set(money32 value) - { - ThrowIfGameStateNotMutable(); - - if (gTotalIncomeFromAdmissions != value) - { - gTotalIncomeFromAdmissions = value; - window_invalidate_by_class(WC_PARK_INFORMATION); - } - } - - money32 landPrice_get() const - { - return gLandPrice; - } - void landPrice_set(money32 value) - { - ThrowIfGameStateNotMutable(); - gLandPrice = value; - } - - money32 constructionRightsPrice_get() const - { - return gConstructionRightsPrice; - } - void constructionRightsPrice_set(money32 value) - { - ThrowIfGameStateNotMutable(); - gConstructionRightsPrice = 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_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/ScRide.hpp b/src/openrct2/scripting/ScRide.hpp deleted file mode 100644 index 877baca8f7..0000000000 --- a/src/openrct2/scripting/ScRide.hpp +++ /dev/null @@ -1,688 +0,0 @@ -/***************************************************************************** - * 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 "../Context.h" -# include "../common.h" -# include "../ride/Ride.h" -# include "Duktape.hpp" -# include "ScObject.hpp" -# include "ScriptEngine.h" - -namespace OpenRCT2::Scripting -{ - template<> inline DukValue ToDuk(duk_context* ctx, const TrackColour& value) - { - DukObject obj(ctx); - obj.Set("main", value.main); - obj.Set("additional", value.additional); - obj.Set("supports", value.supports); - return obj.Take(); - } - - template<> TrackColour FromDuk(const DukValue& s) - { - TrackColour result{}; - result.main = AsOrDefault(s["main"], 0); - result.additional = AsOrDefault(s["additional"], 0); - result.supports = AsOrDefault(s["supports"], 0); - return result; - } - - template<> inline DukValue ToDuk(duk_context* ctx, const VehicleColour& value) - { - DukObject obj(ctx); - obj.Set("body", value.Body); - obj.Set("trim", value.Trim); - obj.Set("ternary", value.Ternary); - return obj.Take(); - } - - template<> VehicleColour FromDuk(const DukValue& s) - { - VehicleColour result{}; - result.Body = AsOrDefault(s["body"], 0); - result.Trim = AsOrDefault(s["trim"], 0); - result.Ternary = AsOrDefault(s["ternary"], 0); - 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: - ride_id_t _rideId = RIDE_ID_NULL; - - public: - ScRide(ride_id_t rideId) - : _rideId(rideId) - { - } - - private: - int32_t id_get() const - { - return _rideId; - } - - 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; - } - - int32_t type_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->type : 0; - } - - 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 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 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 lifecycleFlags_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->lifecycle_flags : 0; - } - - void lifecycleFlags_set(uint32_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->lifecycle_flags = value; - } - } - - uint8_t mode_get() const - { - auto ride = GetRide(); - return ride != nullptr ? static_cast(ride->mode) : 0; - } - - void mode_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->mode = static_cast(value); - } - } - - uint8_t departFlags_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->depart_flags : 0; - } - - void departFlags_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->depart_flags = value; - } - } - - uint8_t minimumWaitingTime_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->min_waiting_time : 0; - } - - void minimumWaitingTime_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->min_waiting_time = value; - } - } - - uint8_t maximumWaitingTime_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->max_waiting_time : 0; - } - - void maximumWaitingTime_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->max_waiting_time = 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 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 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 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 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 stationStyle_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->entrance_style : 0; - } - - void stationStyle_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->entrance_style = value; - } - } - - uint8_t music_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->music : 0; - } - - void music_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->music = 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 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 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 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 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 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 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 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 age_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->GetAge() : 0; - } - - 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; - } - } - - 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; - } - } - - 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); - } - } - - 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); - } - - 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; - } - } - } - - Ride* GetRide() const - { - return get_ride(_rideId); - } - - 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"); - } - }; -} // namespace OpenRCT2::Scripting - -#endif diff --git a/src/openrct2/scripting/ScTile.hpp b/src/openrct2/scripting/ScTile.hpp deleted file mode 100644 index e4dad4855b..0000000000 --- a/src/openrct2/scripting/ScTile.hpp +++ /dev/null @@ -1,1800 +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 - -#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 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: - CoordsXY _coords; - - public: - ScTile(const CoordsXY& coords) - : _coords(coords) - { - } - - private: - int32_t x_get() const - { - return _coords.x / COORDS_XY_STEP; - } - - int32_t y_get() const - { - return _coords.y / COORDS_XY_STEP; - } - - uint32_t numElements_get() const - { - auto first = GetFirstElement(); - return static_cast(GetNumElements(first)); - } - - 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; - } - - 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); - } - - 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); - } - - // 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 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 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 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; - } - - 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"); - } - }; -} // namespace OpenRCT2::Scripting - -#endif diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index db2f1a1801..1e20e96a58 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -17,27 +17,38 @@ # 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" # 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/entity/ScGuest.hpp" +# 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" +# 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" +# 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" +# include "bindings/world/ScPark.hpp" +# include "bindings/world/ScParkMessage.hpp" +# include "bindings/world/ScScenario.hpp" +# include "bindings/world/ScTile.hpp" +# include "bindings/world/ScTileElement.hpp" # include # include @@ -178,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 << " ]"; @@ -400,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); @@ -724,12 +734,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(); } @@ -787,13 +795,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) @@ -867,7 +873,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)); } @@ -879,18 +885,21 @@ 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", rideCreateResult.rideIndex); + const auto rideIndex = result->GetData(); + obj.Set("ride", EnumValue(rideIndex)); } } 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); + } } } @@ -987,7 +996,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 +1077,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); @@ -1172,23 +1182,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() @@ -1394,12 +1402,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() @@ -1417,4 +1423,20 @@ void OpenRCT2::Scripting::ThrowIfGameStateNotMutable() } } +int32_t OpenRCT2::Scripting::GetTargetAPIVersion() +{ + auto& scriptEngine = GetContext()->GetScriptEngine(); + auto& execInfo = scriptEngine.GetExecInfo(); + + // 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 diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index 3eebc71613..f954aff12c 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,7 +46,10 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 31; + static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 38; + + // Versions marking breaking changes. + static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33; # ifndef DISABLE_NETWORK class ScSocketBase; @@ -217,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(); @@ -246,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); @@ -264,6 +268,8 @@ namespace OpenRCT2::Scripting bool IsGameStateMutable(); void ThrowIfGameStateNotMutable(); + int32_t GetTargetAPIVersion(); + std::string Stringify(const DukValue& value); } // namespace OpenRCT2::Scripting diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp new file mode 100644 index 0000000000..55053439bd --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -0,0 +1,210 @@ +/***************************************************************************** + * 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 "../../../peep/Peep.h" +# include "../../../util/Util.h" +# include "../../../world/EntityList.h" +# include "../../../world/Sprite.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" + +# include +# include +# include + +namespace OpenRCT2::Scripting +{ + class ScEntity + { + protected: + uint16_t _id = SPRITE_INDEX_NULL; + + public: + ScEntity(uint16_t id) + : _id(id) + { + } + + private: + int32_t id_get() const + { + auto entity = GetEntity(); + return entity != nullptr ? entity->sprite_index : 0; + } + + std::string type_get() const + { + const auto targetApiVersion = GetTargetAPIVersion(); + + auto entity = GetEntity(); + if (entity != nullptr) + { + switch (entity->Type) + { + case EntityType::Vehicle: + return "car"; + case EntityType::Guest: + if (targetApiVersion <= API_VERSION_33_PEEP_DEPRECATION) + return "peep"; + return "guest"; + case EntityType::Staff: + if (targetApiVersion <= API_VERSION_33_PEEP_DEPRECATION) + return "peep"; + return "staff"; + case EntityType::SteamParticle: + return "steam_particle"; + case EntityType::MoneyEffect: + return "money_effect"; + case EntityType::CrashedVehicleParticle: + return "crashed_vehicle_particle"; + case EntityType::ExplosionCloud: + return "explosion_cloud"; + case EntityType::CrashSplash: + return "crash_splash"; + case EntityType::ExplosionFlare: + return "explosion_flare"; + case EntityType::Balloon: + return "balloon"; + case EntityType::Duck: + return "duck"; + case EntityType::JumpingFountain: + return "jumping_fountain"; + case EntityType::Litter: + return "litter"; + case EntityType::Null: + return "unknown"; + default: + break; + } + } + return "unknown"; + } + + // x getter and setter + int32_t x_get() const + { + auto entity = GetEntity(); + return entity != nullptr ? entity->x : 0; + } + void x_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto entity = GetEntity(); + if (entity != nullptr) + { + entity->MoveTo({ value, entity->y, entity->z }); + } + } + + // y getter and setter + int32_t y_get() const + { + auto entity = GetEntity(); + return entity != nullptr ? entity->y : 0; + } + void y_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto entity = GetEntity(); + if (entity != nullptr) + { + entity->MoveTo({ entity->x, value, entity->z }); + } + } + + // z getter and setter + int16_t z_get() const + { + auto entity = GetEntity(); + return entity != nullptr ? entity->z : 0; + } + void z_set(int16_t value) + { + ThrowIfGameStateNotMutable(); + auto entity = GetEntity(); + if (entity != nullptr) + { + entity->MoveTo({ entity->x, entity->y, value }); + } + } + + void remove() + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto entity = GetEntity(); + if (entity != nullptr) + { + entity->Invalidate(); + switch (entity->Type) + { + case EntityType::Vehicle: + duk_error(ctx, DUK_ERR_ERROR, "Removing a vehicle is currently unsupported."); + break; + case EntityType::Guest: + case EntityType::Staff: + { + auto peep = entity->As(); + // We can't remove a single peep from a ride at the moment as this can cause complications with the + // vehicle car having an unsupported peep capacity. + if (peep == nullptr || peep->State == PeepState::OnRide || peep->State == PeepState::EnteringRide) + { + duk_error(ctx, DUK_ERR_ERROR, "Removing a peep that is on a ride is currently unsupported."); + } + else + { + peep->Remove(); + } + break; + } + case EntityType::SteamParticle: + case EntityType::MoneyEffect: + case EntityType::CrashedVehicleParticle: + case EntityType::ExplosionCloud: + case EntityType::CrashSplash: + case EntityType::ExplosionFlare: + case EntityType::JumpingFountain: + case EntityType::Balloon: + case EntityType::Duck: + case EntityType::Litter: + sprite_remove(entity); + break; + case EntityType::Null: + break; + default: + break; + } + } + } + + EntityBase* GetEntity() const + { + return ::GetEntity(_id); + } + + public: + static void Register(duk_context* ctx) + { + dukglue_register_property(ctx, &ScEntity::id_get, nullptr, "id"); + dukglue_register_property(ctx, &ScEntity::type_get, nullptr, "type"); + dukglue_register_property(ctx, &ScEntity::x_get, &ScEntity::x_set, "x"); + dukglue_register_property(ctx, &ScEntity::y_get, &ScEntity::y_set, "y"); + dukglue_register_property(ctx, &ScEntity::z_get, &ScEntity::z_set, "z"); + dukglue_register_method(ctx, &ScEntity::remove, "remove"); + } + }; + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.cpp b/src/openrct2/scripting/bindings/entity/ScGuest.cpp new file mode 100644 index 0000000000..e5d0901b52 --- /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. + *****************************************************************************/ + +#ifdef ENABLE_SCRIPTING + +# include "ScGuest.hpp" + +# include "../../../peep/Guest.h" + +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/ScLitter.cpp b/src/openrct2/scripting/bindings/entity/ScLitter.cpp new file mode 100644 index 0000000000..0483f7d205 --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScLitter.cpp @@ -0,0 +1,83 @@ +/***************************************************************************** + * 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 "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(); + 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) + { + 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 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..717eb69d0e --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScStaff.cpp @@ -0,0 +1,143 @@ +/***************************************************************************** + * 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" + +# include "../../../peep/Staff.h" + +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 diff --git a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp new file mode 100644 index 0000000000..2f4be2efcb --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp @@ -0,0 +1,465 @@ +/***************************************************************************** + * 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" + +#include "../ride/ScRide.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; + } + } + + int32_t ScVehicle::ride_get() const + { + auto vehicle = GetVehicle(); + return EnumValue(vehicle != nullptr ? vehicle->ride : RIDE_ID_NULL); + } + void ScVehicle::ride_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->ride = static_cast(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..c98cd5b3dc --- /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); + + int32_t ride_get() const; + void ride_set(int32_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/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..6c56554417 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 "Duktape.hpp" -# include "ScriptEngine.h" +# include "../../../Cheats.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 96% rename from src/openrct2/scripting/ScConfiguration.hpp rename to src/openrct2/scripting/bindings/game/ScConfiguration.hpp index 69fb3ab8d8..a7d1477653 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 { @@ -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/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/bindings/network/ScNetwork.cpp b/src/openrct2/scripting/bindings/network/ScNetwork.cpp new file mode 100644 index 0000000000..7b10801034 --- /dev/null +++ b/src/openrct2/scripting/bindings/network/ScNetwork.cpp @@ -0,0 +1,295 @@ +/***************************************************************************** + * 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. + *****************************************************************************/ + +#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 new file mode 100644 index 0000000000..e659b110d5 --- /dev/null +++ b/src/openrct2/scripting/bindings/network/ScNetwork.hpp @@ -0,0 +1,74 @@ +/***************************************************************************** + * 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 "../../Duktape.hpp" +# include "ScPlayer.hpp" +# include "ScPlayerGroup.hpp" +# include "ScSocket.hpp" + +namespace OpenRCT2::Scripting +{ + class ScNetwork + { + private: +# ifdef __clang__ + [[maybe_unused]] +# endif + duk_context* _context; + + public: + 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); + +# ifndef DISABLE_NETWORK + std::shared_ptr createListener(); +# else + void createListener(); +# endif + +# ifndef DISABLE_NETWORK + std::shared_ptr createSocket(); +# else + void createSocket(); +# endif + + static void Register(duk_context* ctx); + }; +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/network/ScPlayer.cpp b/src/openrct2/scripting/bindings/network/ScPlayer.cpp new file mode 100644 index 0000000000..86fd493ba6 --- /dev/null +++ b/src/openrct2/scripting/bindings/network/ScPlayer.cpp @@ -0,0 +1,122 @@ +/***************************************************************************** + * 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 "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 diff --git a/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp b/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp new file mode 100644 index 0000000000..697712f5ba --- /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. + *****************************************************************************/ + +#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 + } + +# ifndef DISABLE_NETWORK + 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; + } +# endif + + 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 + } + + 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 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 97% rename from src/openrct2/scripting/ScObject.hpp rename to src/openrct2/scripting/bindings/object/ScObject.hpp index dfa3e0c457..19f1b09399 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 @@ -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 constexpr std::string_view 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]; diff --git a/src/openrct2/scripting/bindings/ride/ScRide.cpp b/src/openrct2/scripting/bindings/ride/ScRide.cpp new file mode 100644 index 0000000000..6bdd07b4f7 --- /dev/null +++ b/src/openrct2/scripting/bindings/ride/ScRide.cpp @@ -0,0 +1,530 @@ +/***************************************************************************** + * 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. + *****************************************************************************/ + +#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 EnumValue(_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]); + } + } + } + + ObjectEntryIndex ScRide::stationStyle_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->entrance_style : 0; + } + + void ScRide::stationStyle_set(ObjectEntryIndex value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->entrance_style = value; + } + } + + ObjectEntryIndex ScRide::music_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->music : 0; + } + + void ScRide::music_set(ObjectEntryIndex 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 new file mode 100644 index 0000000000..0ee26d3d46 --- /dev/null +++ b/src/openrct2/scripting/bindings/ride/ScRide.hpp @@ -0,0 +1,165 @@ +/***************************************************************************** + * 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 "../../../Context.h" +# include "../../../common.h" +# include "../../../ride/Ride.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" +# include "../object/ScObject.hpp" +# include "ScRideStation.hpp" + +namespace OpenRCT2::Scripting +{ + template<> inline DukValue ToDuk(duk_context* ctx, const TrackColour& value) + { + DukObject obj(ctx); + obj.Set("main", value.main); + obj.Set("additional", value.additional); + obj.Set("supports", value.supports); + return obj.Take(); + } + + template<> inline TrackColour FromDuk(const DukValue& s) + { + TrackColour result{}; + result.main = AsOrDefault(s["main"], 0); + result.additional = AsOrDefault(s["additional"], 0); + result.supports = AsOrDefault(s["supports"], 0); + return result; + } + + template<> inline DukValue ToDuk(duk_context* ctx, const VehicleColour& value) + { + DukObject obj(ctx); + obj.Set("body", value.Body); + obj.Set("trim", value.Trim); + obj.Set("ternary", value.Ternary); + return obj.Take(); + } + + template<> inline VehicleColour FromDuk(const DukValue& s) + { + VehicleColour result{}; + result.Body = AsOrDefault(s["body"], 0); + result.Trim = AsOrDefault(s["trim"], 0); + result.Ternary = AsOrDefault(s["ternary"], 0); + return result; + } + + class ScRide + { + private: + ride_id_t _rideId = RIDE_ID_NULL; + + public: + ScRide(ride_id_t rideId); + + private: + int32_t id_get() const; + + std::shared_ptr object_get(); + + int32_t type_get() const; + + std::string classification_get() const; + + std::string name_get() const; + void name_set(std::string value); + + std::string status_get() const; + + uint32_t lifecycleFlags_get() const; + + void lifecycleFlags_set(uint32_t value); + + uint8_t mode_get() const; + + void mode_set(uint8_t value); + + uint8_t departFlags_get() const; + + void departFlags_set(uint8_t value); + + uint8_t minimumWaitingTime_get() const; + + void minimumWaitingTime_set(uint8_t value); + + uint8_t maximumWaitingTime_get() const; + + void maximumWaitingTime_set(uint8_t value); + + std::vector vehicles_get() const; + + std::vector vehicleColours_get() const; + + void vehicleColours_set(const std::vector& value); + + std::vector colourSchemes_get() const; + + void colourSchemes_set(const std::vector& value); + + ObjectEntryIndex stationStyle_get() const; + + void stationStyle_set(ObjectEntryIndex value); + + ObjectEntryIndex music_get() const; + + void music_set(ObjectEntryIndex value); + + std::vector> stations_get() const; + + std::vector price_get() const; + + void price_set(const std::vector& value); + + int32_t excitement_get() const; + void excitement_set(int32_t value); + + int32_t intensity_get() const; + void intensity_set(int32_t value); + + int32_t nausea_get() const; + void nausea_set(int32_t value); + + int32_t totalCustomers_get() const; + void totalCustomers_set(int32_t value); + + int32_t buildDate_get() const; + void buildDate_set(int32_t value); + + int32_t age_get() const; + + int16_t runningCost_get() const; + void runningCost_set(int16_t value); + + int32_t totalProfit_get() const; + void totalProfit_set(int32_t value); + + uint8_t inspectionInterval_get() const; + void inspectionInterval_set(uint8_t value); + + DukValue value_get() const; + + void value_set(const DukValue& value); + + uint8_t downtime_get() const; + + Ride* GetRide() const; + + public: + static void Register(duk_context* ctx); + }; +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/ride/ScRideStation.cpp b/src/openrct2/scripting/bindings/ride/ScRideStation.cpp new file mode 100644 index 0000000000..1168d96060 --- /dev/null +++ b/src/openrct2/scripting/bindings/ride/ScRideStation.cpp @@ -0,0 +1,134 @@ +/***************************************************************************** + * 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. + *****************************************************************************/ + +#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 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/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp new file mode 100644 index 0000000000..0a672ad6b1 --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -0,0 +1,278 @@ +/***************************************************************************** + * 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 "../../../peep/Guest.h" +# include "../../../peep/Staff.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) + { + DukValue res; + if (type == "car") + { + res = createEntityType(_context, initializer); + } + else if (type == "staff") + { + res = createEntityType(_context, initializer); + } + else if (type == "guest") + { + res = createEntityType(_context, initializer); + } + else if (type == "steam_particle") + { + res = createEntityType(_context, initializer); + } + else if (type == "money_effect") + { + res = createEntityType(_context, initializer); + } + else if (type == "crashed_vehicle_particle") + { + res = createEntityType(_context, initializer); + } + else if (type == "explosion_cloud") + { + res = createEntityType(_context, initializer); + } + else if (type == "crash_splash") + { + res = createEntityType(_context, initializer); + } + else if (type == "explosion_flare") + { + res = createEntityType(_context, initializer); + } + else if (type == "balloon") + { + res = createEntityType(_context, initializer); + } + else if (type == "duck") + { + res = createEntityType(_context, initializer); + } + else if (type == "jumping_fountain") + { + res = createEntityType(_context, initializer); + } + else if (type == "litter") + { + res = createEntityType(_context, initializer); + } + else + { + duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); + } + + return res; + } + + 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 EntityBase* 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 new file mode 100644 index 0000000000..2d6ca62549 --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScMap.hpp @@ -0,0 +1,55 @@ +/***************************************************************************** + * 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 "../../../common.h" +# include "../../Duktape.hpp" +# include "../ride/ScRide.hpp" +# include "../world/ScTile.hpp" + +namespace OpenRCT2::Scripting +{ + class ScMap + { + private: + duk_context* _context; + + public: + ScMap(duk_context* ctx); + + DukValue size_get() const; + + int32_t numRides_get() const; + + int32_t numEntities_get() const; + + std::vector> rides_get() const; + + std::shared_ptr getRide(int32_t id) const; + + std::shared_ptr getTile(int32_t x, int32_t y) const; + + DukValue getEntity(int32_t id) const; + + std::vector getAllEntities(const std::string& type) const; + + DukValue createEntity(const std::string& type, const DukValue& initializer); + + static void Register(duk_context* ctx); + + private: + DukValue GetEntityAsDukValue(const EntityBase* sprite) const; + }; + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/world/ScPark.cpp b/src/openrct2/scripting/bindings/world/ScPark.cpp new file mode 100644 index 0000000000..b411dfcda1 --- /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/Guest.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 new file mode 100644 index 0000000000..10fb765abb --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScPark.hpp @@ -0,0 +1,98 @@ +/***************************************************************************** + * 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 "../../Duktape.hpp" +# include "ScParkMessage.hpp" + +# include +# include + +namespace OpenRCT2::Scripting +{ + class ScPark + { + public: + money64 cash_get() const; + void cash_set(money64 value); + + int32_t rating_get() const; + void rating_set(int32_t value); + + money64 bankLoan_get() const; + void bankLoan_set(money64 value); + + money64 maxBankLoan_get() const; + void maxBankLoan_set(money64 value); + + money16 entranceFee_get() const; + void entranceFee_set(money16 value); + + uint32_t guests_get() const; + + uint32_t suggestedGuestMaximum_get() const; + + int32_t guestGenerationProbability_get() const; + + money16 guestInitialCash_get() const; + + uint8_t guestInitialHappiness_get() const; + + uint8_t guestInitialHunger_get() const; + + uint8_t guestInitialThirst_get() const; + + money64 value_get() const; + void value_set(money64 value); + + money64 companyValue_get() const; + void companyValue_set(money64 value); + + money16 totalRideValueForMoney_get() const; + + uint32_t totalAdmissions_get() const; + void totalAdmissions_set(uint32_t value); + + money64 totalIncomeFromAdmissions_get() const; + void totalIncomeFromAdmissions_set(money64 value); + + money32 landPrice_get() const; + void landPrice_set(money32 value); + + money32 constructionRightsPrice_get() const; + void constructionRightsPrice_set(money32 value); + + int16_t casualtyPenalty_get() const; + void casualtyPenalty_set(int16_t value); + + uint16_t parkSize_get() const; + + std::string name_get() const; + void name_set(std::string value); + + bool getFlag(const std::string& key) const; + + void setFlag(const std::string& key, bool value); + + std::vector> messages_get() const; + + void messages_set(const std::vector& value); + + void postMessage(DukValue message); + + static void Register(duk_context* ctx); + }; +} // namespace OpenRCT2::Scripting + +#endif 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..48801a50a3 --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScParkMessage.hpp @@ -0,0 +1,103 @@ +/***************************************************************************** + * 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 +# 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 diff --git a/src/openrct2/scripting/ScScenario.hpp b/src/openrct2/scripting/bindings/world/ScScenario.hpp similarity index 91% rename from src/openrct2/scripting/ScScenario.hpp rename to src/openrct2/scripting/bindings/world/ScScenario.hpp index 5a2174a846..d912be2d0f 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 @@ -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,9 +261,9 @@ 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) + if (gScenarioCompletedCompanyValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) return "failed"; return "completed"; } @@ -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/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 new file mode 100644 index 0000000000..1698377c42 --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScTile.hpp @@ -0,0 +1,61 @@ +/***************************************************************************** + * 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 "../../../common.h" +# include "../../Duktape.hpp" +# include "ScTileElement.hpp" + +# include +# include +# include +# include + +namespace OpenRCT2::Scripting +{ + class ScTile + { + private: + CoordsXY _coords; + + public: + ScTile(const CoordsXY& coords); + + private: + int32_t x_get() const; + + int32_t y_get() const; + + uint32_t numElements_get() const; + + std::vector> elements_get() const; + + DukValue data_get() const; + void data_set(DukValue value); + + std::shared_ptr getElement(uint32_t index) const; + std::shared_ptr insertElement(uint32_t index); + + void removeElement(uint32_t index); + + TileElement* GetFirstElement() const; + + static size_t GetNumElements(const TileElement* first); + + duk_context* GetDukContext() const; + + public: + static void Register(duk_context* ctx); + }; +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp new file mode 100644 index 0000000000..c582c6dd81 --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -0,0 +1,1567 @@ +/***************************************************************************** + * 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) + { + if (value == "surface") + _element->type = TILE_ELEMENT_TYPE_SURFACE; + else if (value == "footpath") + _element->type = TILE_ELEMENT_TYPE_PATH; + else if (value == "track") + _element->type = TILE_ELEMENT_TYPE_TRACK; + else if (value == "small_scenery") + _element->type = TILE_ELEMENT_TYPE_SMALL_SCENERY; + else if (value == "entrance") + _element->type = TILE_ELEMENT_TYPE_ENTRANCE; + else if (value == "wall") + _element->type = TILE_ELEMENT_TYPE_WALL; + else if (value == "large_scenery") + _element->type = TILE_ELEMENT_TYPE_LARGE_SCENERY; + else if (value == "banner") + _element->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; + } + + 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, EnumValue(el->GetRideIndex())); + else + duk_push_null(ctx); + break; + } + case TILE_ELEMENT_TYPE_TRACK: + { + auto el = _element->AsTrack(); + duk_push_int(ctx, EnumValue(el->GetRideIndex())); + break; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + { + auto el = _element->AsEntrance(); + duk_push_int(ctx, EnumValue(el->GetRideIndex())); + break; + } + default: + { + duk_push_null(ctx); + break; + } + } + return DukValue::take_from_stack(ctx); + } + void ScTileElement::ride_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_PATH: + { + auto el = _element->AsPath(); + if (!el->HasAddition()) + { + el->SetRideIndex(static_cast(value)); + Invalidate(); + } + break; + } + case TILE_ELEMENT_TYPE_TRACK: + { + auto el = _element->AsTrack(); + el->SetRideIndex(static_cast(value)); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + { + auto el = _element->AsEntrance(); + el->SetRideIndex(static_cast(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->GetLegacyPathEntryIndex()); + 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->SetLegacyPathEntryIndex(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->GetLegacyPathEntryIndex()); + 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->SetLegacyPathEntryIndex(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..7fa36099ea --- /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(int32_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 diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index 87b9c8ee91..0965ea5fd0 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" @@ -865,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, @@ -1090,7 +1091,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, @@ -1098,5 +1099,3 @@ enum SPR_IMAGE_LIST_BEGIN = SPR_SCROLLING_TEXT_END, SPR_IMAGE_LIST_END = 0x7FFFE }; - -#endif diff --git a/src/openrct2/title/TitleScreen.cpp b/src/openrct2/title/TitleScreen.cpp index f267ae4891..02e134ef8f 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,9 @@ void TitleScreen::Load() gScreenAge = 0; gCurrentLoadedPath = ""; - network_close(); +#ifndef DISABLE_NETWORK + GetContext()->GetNetwork().Close(); +#endif OpenRCT2::Audio::StopAll(); GetContext()->GetGameState()->InitAll(150); viewport_init_all(); diff --git a/src/openrct2/title/TitleSequence.cpp b/src/openrct2/title/TitleSequence.cpp index c5e47ca72a..83960d0990 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); @@ -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/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/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/ui/UiContext.h b/src/openrct2/ui/UiContext.h index 0f557defef..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 @@ -138,7 +139,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 +159,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/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/util/SawyerCoding.cpp b/src/openrct2/util/SawyerCoding.cpp index b8c2fb586d..0456aa6a9c 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); @@ -414,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/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/util/Util.cpp b/src/openrct2/util/Util.cpp index 1cd52ab180..e15fde7beb 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; } @@ -388,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) { @@ -458,10 +456,8 @@ char* safe_strcat(char* destination, const char* source, size_t size) { break; } - else - { - destination++; - } + + destination++; } bool terminated = false; @@ -566,7 +562,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); @@ -696,6 +692,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)))) \ @@ -729,6 +821,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 +835,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..5acfa086fd 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" @@ -57,13 +56,17 @@ 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); +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); 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); @@ -86,5 +89,3 @@ template constexpr auto EnumValue(TEnum enumerator) noexcept { return static_cast>(enumerator); } - -#endif diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 3116c22498..df54293b1b 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" @@ -27,10 +28,11 @@ #include #include +using namespace OpenRCT2::TrackMetaData; 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 @@ -49,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; @@ -76,51 +77,46 @@ 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); + if (res->Error != GameActions::Status::Ok) + return MONEY32_UNDEFINED; + + 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 rct_track_coordinates& coords = TrackCoordinates[trackType]; - 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; + + const auto resultData = res->GetData(); + viewport_set_visibility((resultData.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 res->Cost; } static std::tuple window_ride_construction_update_state_get_track_element() @@ -133,7 +129,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 +146,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 +201,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) { @@ -304,20 +300,23 @@ bool window_ride_construction_update_state( && _currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_PIECES) { auto availablePieces = rtd.CoveredTrackPieces; - auto alternativeType = AlternativeTrackTypes[trackType]; + const auto& ted = GetTrackElementDescriptor(trackType); + auto alternativeType = ted.AlternativeType; if (alternativeType != TrackElemType::None && (availablePieces & (1ULL << trackType))) { trackType = alternativeType; - liftHillAndInvertedState &= ~CONSTRUCTION_LIFT_HILL_SELECTED; + if (!gCheatsEnableChainLiftOnAllTrack) + liftHillAndInvertedState &= ~CONSTRUCTION_LIFT_HILL_SELECTED; } } - const rct_track_coordinates& trackCoordinates = TrackCoordinates[trackType]; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_track_coordinates& trackCoordinates = ted.Coordinates; 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; @@ -345,13 +344,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 (ted.Flags & TRACK_ELEM_FLAG_CURVE_ALLOWS_LIFT) { turnOffLiftHill = true; } } - if (!(TrackFlags[trackType] & TRACK_ELEM_FLAG_ALLOW_LIFT_HILL)) + if (!(ted.Flags & TRACK_ELEM_FLAG_ALLOW_LIFT_HILL)) { turnOffLiftHill = true; } @@ -401,7 +400,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 +431,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 +463,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 +481,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(); } 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/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/Banner.cpp b/src/openrct2/world/Banner.cpp index de001a8541..ce9993d6b4 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" @@ -31,7 +32,7 @@ #include #include -static Banner _banners[MAX_BANNERS]; +static std::vector _banners; std::string Banner::GetText() const { @@ -114,9 +115,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 +137,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) @@ -170,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 @@ -191,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; @@ -219,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) { @@ -246,7 +223,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); @@ -261,12 +238,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,55 +255,51 @@ 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; + 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[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 newBannerIndex = create_new_banner(GAME_COMMAND_FLAG_APPLY); - if (newBannerIndex == BANNER_INDEX_NULL) - { - log_error("Failed to create new banner."); - continue; - } - Guard::Assert(!activeBanners[newBannerIndex]); - - // Copy over the original banner, but update the location - auto newBanner = GetBanner(newBannerIndex); - auto oldBanner = GetBanner(bannerIndex); - if (oldBanner != nullptr && newBanner != nullptr) - { - *newBanner = *oldBanner; - newBanner->position = { x, y }; - } - - tileElement->AsBanner()->SetIndex(newBannerIndex); - } - - // 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; } } } @@ -379,11 +356,114 @@ 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()) { - return &_banners[id]; + 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); + } + // Create the banner + auto& banner = _banners[id]; + banner.id = id; + return &banner; + } + 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 = COLOUR_WHITE; + banner->text_colour = COLOUR_WHITE; + } + 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/Climate.cpp b/src/openrct2/world/Climate.cpp index 731922ab31..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; @@ -222,10 +225,8 @@ bool climate_is_raining() { return true; } - else - { - return false; - } + + return false; } bool climate_is_snowing() @@ -235,10 +236,8 @@ bool climate_is_snowing() { return true; } - else - { - return false; - } + + return false; } bool WeatherIsDry(WeatherType weatherType) @@ -274,10 +273,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/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp new file mode 100644 index 0000000000..62f52901c8 --- /dev/null +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -0,0 +1,344 @@ +/***************************************************************************** + * 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 "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 + */ +GameActions::Result::Ptr MapCanConstructWithClearAt( + const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, uint8_t crossingMode, bool isTree) +{ + auto res = std::make_unique(); + + uint8_t groundFlags = ELEMENT_IS_ABOVE_GROUND; + res->SetData(ConstructClearResult{ groundFlags }); + + bool canBuildCrossing = false; + if (map_is_edge(pos)) + { + res->Error = GameActions::Status::InvalidParameters; + res->ErrorMessage = STR_OFF_EDGE_OF_MAP; + return res; + } + + if (gCheatsDisableClearanceChecks) + { + res->SetData(ConstructClearResult{ groundFlags }); + 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; + } + + map_obstruction_set_error_text(tileElement, *res); + res->Error = GameActions::Status::NoClearance; + return res; + } + } + continue; + } + + const auto waterHeight = tileElement->AsSurface()->GetWaterHeight(); + if (waterHeight && waterHeight > pos.baseZ && tileElement->GetBaseZ() < pos.clearanceZ) + { + groundFlags |= ELEMENT_IS_UNDERWATER; + if (waterHeight < pos.clearanceZ) + { + if (clearFunc != nullptr && clearFunc(&tileElement, pos, flags, &res->Cost)) + { + 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) + { + const 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 + groundFlags |= ELEMENT_IS_UNDERGROUND; + groundFlags &= ~ELEMENT_IS_ABOVE_GROUND; + } + else + { + 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; + 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; + } + 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))) + { + continue; + } + + if (MapLoc68BABCShouldContinue(tileElement, pos, clearFunc, flags, res->Cost, crossingMode, canBuildCrossing)) + { + continue; + } + + map_obstruction_set_error_text(tileElement, *res); + res->Error = GameActions::Status::NoClearance; + return res; + } + } + } while (!(tileElement++)->IsLastForTile()); + + res->SetData(ConstructClearResult{ groundFlags }); + + return res; +} + +GameActions::Result::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..557bada5b5 --- /dev/null +++ b/src/openrct2/world/ConstructionClearance.h @@ -0,0 +1,39 @@ +/***************************************************************************** + * 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" +#include "../common.h" +#include "Map.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); +int32_t map_place_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); + +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]] GameActions::Result::Ptr MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl); + +void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Result& res); 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/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.cpp b/src/openrct2/world/Entity.cpp index 3d3624dd4e..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" @@ -18,7 +19,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; @@ -186,9 +187,7 @@ void Guest::Serialise(DataSerialiser& stream) stream << TimeToConsume; stream << Intensity; stream << NauseaTolerance; - stream << RideTypesBeenOn; stream << TimeInQueue; - stream << RidesBeenOn; stream << CashInPocket; stream << CashSpent; stream << Photo1RideRef; @@ -225,7 +224,6 @@ void Staff::Serialise(DataSerialiser& stream) stream << AssignedStaffType; stream << MechanicTimeSinceCall; stream << HireDate; - stream << StaffId; stream << StaffOrders; stream << StaffMowingTimeout; stream << StaffLawnsMown; @@ -280,8 +278,7 @@ void Vehicle::Serialise(DataSerialiser& stream) stream << powered_acceleration; stream << dodgems_collision_direction; stream << animation_frame; - stream << var_C8; - stream << var_CA; + stream << animationState; stream << scream_sound_id; stream << TrackSubposition; stream << var_CE; diff --git a/src/openrct2/world/Entity.h b/src/openrct2/world/Entity.h index e2e6fd7cd4..407f474afe 100644 --- a/src/openrct2/world/Entity.h +++ b/src/openrct2/world/Entity.h @@ -9,33 +9,33 @@ #pragma once -#include "SpriteBase.h" +#include "EntityBase.h" 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/SpriteBase.h b/src/openrct2/world/EntityBase.h similarity index 86% rename from src/openrct2/world/SpriteBase.h rename to src/openrct2/world/EntityBase.h index ee84d6d62c..125193fef1 100644 --- a/src/openrct2/world/SpriteBase.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 { @@ -23,13 +22,13 @@ enum class EntityType : uint8_t Null = 255 }; -struct SpriteBase +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 @@ -37,10 +36,7 @@ struct SpriteBase // 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; @@ -74,7 +70,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 2c43d33c9f..60d967aac5 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 @@ -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; @@ -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)); } diff --git a/src/openrct2/world/EntityTweener.cpp b/src/openrct2/world/EntityTweener.cpp index aa77dd5a05..63c033019e 100644 --- a/src/openrct2/world/EntityTweener.cpp +++ b/src/openrct2/world/EntityTweener.cpp @@ -8,29 +8,29 @@ *****************************************************************************/ #include "EntityTweener.h" -#include "../peep/Peep.h" +#include "../peep/Guest.h" +#include "../peep/Staff.h" #include "../ride/Vehicle.h" #include "EntityList.h" #include "Sprite.h" #include - 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,12 +52,12 @@ void EntityTweener::PostTick() } else { - PostPos.emplace_back(ent->x, ent->y, ent->z); + PostPos.emplace_back(ent->GetLocation()); } } } -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 7e6dfaf843..d5a1026786 100644 --- a/src/openrct2/world/EntityTweener.h +++ b/src/openrct2/world/EntityTweener.h @@ -9,13 +9,13 @@ #pragma once -#include "SpriteBase.h" +#include "EntityBase.h" #include 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/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 73b3e17c08..49685c3508 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" @@ -18,6 +19,9 @@ #include "../localisation/StringIds.h" #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" @@ -254,12 +258,65 @@ void EntranceElement::SetSequenceIndex(uint8_t newSequenceIndex) SequenceIndex |= (newSequenceIndex & 0xF); } -PathSurfaceIndex EntranceElement::GetPathType() const +bool EntranceElement::HasLegacyPathEntry() const { + return (flags2 & ENTRANCE_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) != 0; +} + +ObjectEntryIndex EntranceElement::GetLegacyPathEntryIndex() const +{ + if (HasLegacyPathEntry()) + return PathType; + + 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; + return PathType; } -void EntranceElement::SetPathType(PathSurfaceIndex newPathType) +const FootpathSurfaceObject* EntranceElement::GetSurfaceEntry() const { - PathType = newPathType; + 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 +{ + if (HasLegacyPathEntry()) + { + const auto* legacyPathEntry = GetLegacyPathEntry(); + if (legacyPathEntry == nullptr) + return nullptr; + + return &legacyPathEntry->GetPathSurfaceDescriptor(); + } + + const auto* surfaceEntry = GetSurfaceEntry(); + if (surfaceEntry == nullptr) + return nullptr; + + return &surfaceEntry->GetDescriptor(); } diff --git a/src/openrct2/world/Entrance.h b/src/openrct2/world/Entrance.h index f8dbfbcd63..cd89adbe4b 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" @@ -29,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; @@ -56,5 +60,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/Footpath.cpp b/src/openrct2/world/Footpath.cpp index c165741480..b514ec864d 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" @@ -38,8 +40,10 @@ #include #include +using namespace OpenRCT2::TrackMetaData; void footpath_update_queue_entrance_banner(const CoordsXY& footpathPos, TileElement* tileElement); +FootpathSelection gFootpathSelection; ProvisionalFootpath gProvisionalFootpath; uint16_t gFootpathSelectedId; CoordsXYZ gFootpathConstructFromPosition; @@ -65,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[] = { @@ -94,16 +103,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) @@ -138,21 +145,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) @@ -245,7 +256,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; @@ -258,7 +269,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; } } @@ -343,7 +354,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; @@ -353,7 +364,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 +381,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)); @@ -580,19 +591,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) @@ -854,7 +862,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)) @@ -882,13 +890,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& ted = GetTrackElementDescriptor(trackType); + if (!(ted.SequenceProperties[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 (!(ted.SequenceProperties[trackSequence] & (1 << dx))) { return; } @@ -903,7 +913,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 +952,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; } @@ -962,12 +974,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& ted = GetTrackElementDescriptor(trackType); + if (!(ted.SequenceProperties[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 (!(ted.SequenceProperties[trackSequence] & (1 << dx))) { return; } @@ -1215,10 +1228,10 @@ 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()); + TileElement* tileElement = map_get_first_element_at(location); if (tileElement != nullptr) { do @@ -1412,7 +1425,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 +1435,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 @@ -1640,37 +1651,108 @@ void PathElement::SetAdditionIsGhost(bool isGhost) Flags2 |= FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST; } -PathSurfaceIndex PathElement::GetSurfaceEntryIndex() const +ObjectEntryIndex PathElement::GetLegacyPathEntryIndex() const { + if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) + return SurfaceIndex; + + return OBJECT_ENTRY_INDEX_NULL; +} + +const FootpathObject* PathElement::GetLegacyPathEntry() const +{ + return GetLegacyFootpathEntry(GetLegacyPathEntryIndex()); +} + +void PathElement::SetLegacyPathEntryIndex(ObjectEntryIndex newIndex) +{ + SurfaceIndex = newIndex; + RailingsIndex = OBJECT_ENTRY_INDEX_NULL; + 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 +{ + 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; + + return &surfaceEntry->GetDescriptor(); +} + +const PathRailingsDescriptor* PathElement::GetRailingsDescriptor() const +{ + if (HasLegacyPathEntry()) + { + const auto* legacyPathEntry = GetLegacyPathEntry(); + if (legacyPathEntry == nullptr) + return nullptr; + + return &legacyPathEntry->GetPathRailingsDescriptor(); + } + + const auto* railingsEntry = GetRailingsEntry(); + if (railingsEntry == nullptr) + return nullptr; + + return &railingsEntry->GetDescriptor(); +} + +ObjectEntryIndex PathElement::GetSurfaceEntryIndex() const +{ + if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) + return OBJECT_ENTRY_INDEX_NULL; + return SurfaceIndex; } -PathRailingsIndex PathElement::GetRailingEntryIndex() const +const FootpathSurfaceObject* PathElement::GetSurfaceEntry() const { - return GetSurfaceEntryIndex(); + auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); + return static_cast(objMgr.GetLoadedObject(ObjectType::FootpathSurface, GetSurfaceEntryIndex())); } -PathSurfaceEntry* PathElement::GetSurfaceEntry() const +void PathElement::SetSurfaceEntryIndex(ObjectEntryIndex newIndex) { - if (!IsQueue()) - return get_path_surface_entry(GetSurfaceEntryIndex()); - else - return get_path_surface_entry(GetSurfaceEntryIndex() + MAX_PATH_OBJECTS); + SurfaceIndex = newIndex; + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; } -PathRailingsEntry* PathElement::GetRailingEntry() const +ObjectEntryIndex PathElement::GetRailingsEntryIndex() const { - return get_path_railings_entry(GetRailingEntryIndex()); + if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) + return OBJECT_ENTRY_INDEX_NULL; + + return RailingsIndex; } -void PathElement::SetSurfaceEntryIndex(PathSurfaceIndex newIndex) +const FootpathRailingsObject* PathElement::GetRailingsEntry() const { - SurfaceIndex = newIndex & ~FOOTPATH_ELEMENT_INSERT_QUEUE; + auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); + return static_cast(objMgr.GetLoadedObject(ObjectType::FootpathRailings, GetRailingsEntryIndex())); } -void PathElement::SetRailingEntryIndex(PathRailingsIndex newEntryIndex) +void PathElement::SetRailingsEntryIndex(ObjectEntryIndex newEntryIndex) { - log_verbose("Setting railing entry index to %d", newEntryIndex); + RailingsIndex = newEntryIndex; + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; } uint8_t PathElement::GetQueueBannerDirection() const @@ -1686,7 +1768,8 @@ void PathElement::SetQueueBannerDirection(uint8_t direction) bool PathElement::ShouldDrawPathOverSupports() const { - return (GetRailingEntry()->flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS); + // TODO: make this an actual decision of the tile element. + return (GetRailingsDescriptor()->Flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS); } void PathElement::SetShouldDrawPathOverSupports(bool on) @@ -2065,7 +2148,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 @@ -2082,7 +2165,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; } @@ -2105,10 +2188,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& ted = GetTrackElementDescriptor(trackType); + if (ted.SequenceProperties[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 (ted.SequenceProperties[trackSequence] & (1 << dx)) { // Track element has the flags required for the given direction return true; @@ -2119,7 +2203,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; @@ -2244,32 +2328,35 @@ void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElem tileElement->AsPath()->SetEdgesAndCorners(0); } -PathSurfaceEntry* get_path_surface_entry(PathSurfaceIndex entryIndex) +const FootpathObject* GetLegacyFootpathEntry(ObjectEntryIndex entryIndex) { - PathSurfaceEntry* 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; -} - -PathRailingsEntry* get_path_railings_entry(PathRailingsIndex entryIndex) -{ - PathRailingsEntry* 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; +} + +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 diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 98318556fd..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,13 +29,7 @@ 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 - -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 +38,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 { @@ -49,27 +54,77 @@ 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 + { + // 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 + { + return image + 73; + } }; 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; + + inline constexpr bool IsEditorOnly() const + { + return Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR; + } }; -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; + 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 @@ -78,6 +133,9 @@ struct ProvisionalFootpath CoordsXYZ Position; uint8_t Slope; uint8_t Flags; + ObjectEntryIndex SurfaceIndex; + ObjectEntryIndex RailingsIndex; + PathConstructFlags ConstructFlags; }; // Masks for values stored in TileElement.type @@ -111,12 +169,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), -}; - -enum -{ - FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR = (1 << 2), - FOOTPATH_ENTRY_FLAG_IS_QUEUE = (1 << 3), + FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY = (1 << 5), }; enum @@ -166,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; @@ -180,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); @@ -196,10 +252,10 @@ 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); +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/Fountain.cpp b/src/openrct2/world/Fountain.cpp index 13cb54bb79..2bf539ea20 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,23 +39,27 @@ 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 // 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 @@ -67,10 +71,10 @@ 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 SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::JumpingFountain; } 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.cpp b/src/openrct2/world/Litter.cpp index f2fa1d8108..a5310d9f42 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; } /** @@ -121,7 +122,12 @@ 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)]; } + +uint32_t Litter::GetAge() const +{ + return gCurrentTicks - creationTick; +} diff --git a/src/openrct2/world/Litter.h b/src/openrct2/world/Litter.h index b1cfe0a62f..52c8381f60 100644 --- a/src/openrct2/world/Litter.h +++ b/src/openrct2/world/Litter.h @@ -9,13 +9,13 @@ #pragma once -#include "SpriteBase.h" +#include "EntityBase.h" class DataSerialiser; struct CoordsXYZ; struct CoordsXYZD; -struct Litter : SpriteBase +struct Litter : EntityBase { enum class Type : uint8_t { @@ -40,4 +40,5 @@ struct Litter : SpriteBase 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/Location.hpp b/src/openrct2/world/Location.hpp index 7fd725fffa..62fb7025e1 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 @@ -26,46 +27,46 @@ constexpr int32_t COORDS_NULL = 0xFFFF8000; struct ScreenCoordsXY { - int32_t x = 0; - int32_t y = 0; + int32_t x{}; + int32_t y{}; - 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 +77,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); } @@ -100,10 +101,10 @@ struct ScreenSize */ struct CoordsXY { - int32_t x = 0; - int32_t y = 0; + int32_t x{}; + int32_t y{}; - CoordsXY() = default; + constexpr CoordsXY() = default; constexpr CoordsXY(int32_t _x, int32_t _y) : x(_x) , y(_y) @@ -215,12 +216,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; @@ -229,9 +230,9 @@ struct CoordsXY struct CoordsXYZ : public CoordsXY { - int32_t z = 0; + int32_t z{}; - CoordsXYZ() = default; + constexpr CoordsXYZ() = default; constexpr CoordsXYZ(int32_t _x, int32_t _y, int32_t _z) : CoordsXY(_x, _y) , z(_z) @@ -244,38 +245,44 @@ 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 }; } + + constexpr void SetNull() + { + CoordsXY::SetNull(); + z = 0; + } }; struct CoordsXYRangedZ : public CoordsXY { - int32_t baseZ = 0; - int32_t clearanceZ = 0; + int32_t baseZ{}; + int32_t clearanceZ{}; - CoordsXYRangedZ() = default; + constexpr CoordsXYRangedZ() = default; constexpr CoordsXYRangedZ(int32_t _x, int32_t _y, int32_t _baseZ, int32_t _clearanceZ) : CoordsXY(_x, _y) , baseZ(_baseZ) @@ -300,54 +307,54 @@ struct CoordsXYRangedZ : public CoordsXY struct TileCoordsXY { - int32_t x = 0; - int32_t y = 0; + int32_t x{}; + int32_t y{}; - 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()) + if (IsNull()) { CoordsXY ret{}; - ret.setNull(); + ret.SetNull(); return ret; } 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) @@ -374,22 +381,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; @@ -398,67 +405,73 @@ struct TileCoordsXY struct TileCoordsXYZ : public TileCoordsXY { - int32_t z = 0; + int32_t z{}; - 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()) + 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() + { + TileCoordsXY::SetNull(); + z = 0; + } }; /** @@ -478,18 +491,23 @@ 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, * 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; } @@ -498,7 +516,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; } @@ -507,7 +525,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; } @@ -515,7 +533,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; @@ -527,17 +545,23 @@ constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; { return y_diff < 0 ? 3 : 1; } - else - { - return x_diff < 0 ? 0 : 2; - } + + return x_diff < 0 ? 0 : 2; +} + +/* + * 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 = 0; + Direction direction{}; - CoordsXYZD() = default; + constexpr CoordsXYZD() = default; constexpr CoordsXYZD(int32_t _x, int32_t _y, int32_t _z, Direction _d) : CoordsXYZ(_x, _y, _z) , direction(_d) @@ -556,49 +580,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 }; } @@ -606,49 +630,61 @@ struct CoordsXYZD : public CoordsXYZ struct TileCoordsXYZD : public TileCoordsXYZ { - Direction direction; + 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 TileCoordsXY& t_, int32_t z_, Direction d_) + constexpr TileCoordsXYZD(const TileCoordsXYZ& t_, Direction d_) + : TileCoordsXYZ(t_) + , 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()) + 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() + { + TileCoordsXYZ::SetNull(); + direction = INVALID_DIRECTION; + } }; /** @@ -659,30 +695,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) { @@ -693,29 +729,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) { } @@ -729,7 +765,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()), @@ -744,7 +780,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) { } @@ -758,15 +794,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(); } diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 875484769e..a8b1cc7d51 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; @@ -93,11 +94,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 +106,8 @@ bool gClearSmallScenery; bool gClearLargeScenery; bool gClearFootpath; -uint16_t gLandRemainingOwnershipSales; -uint16_t gLandRemainingConstructionSales; +uint32_t gLandRemainingOwnershipSales; +uint32_t gLandRemainingConstructionSales; bool gMapLandRightsUpdateSuccess; @@ -119,8 +117,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 +124,6 @@ void StashMap() { _tileIndexStash = std::move(_tileIndex); _tileElementsStash = std::move(_tileElements); - _mapSizeUnitsStash = gMapSizeUnits; - _mapSizeMinus2Stash = gMapSizeMinus2; _mapSizeStash = gMapSize; _currentRotationStash = gCurrentRotation; _tileElementsInUseStash = _tileElementsInUse; @@ -139,8 +133,6 @@ void UnstashMap() { _tileIndex = std::move(_tileIndexStash); _tileElements = std::move(_tileElementsStash); - gMapSizeUnits = _mapSizeUnitsStash; - gMapSizeMinus2 = _mapSizeMinus2Stash; gMapSize = _mapSizeStash; gCurrentRotation = _currentRotationStash; _tileElementsInUse = _tileElementsInUseStash; @@ -168,7 +160,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(); @@ -207,7 +199,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; } @@ -217,25 +208,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); @@ -253,14 +242,14 @@ 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) { 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; } @@ -273,7 +262,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; } @@ -281,7 +270,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; } @@ -293,15 +282,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) @@ -404,10 +404,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(); @@ -651,7 +648,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; @@ -753,7 +750,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) @@ -789,8 +786,6 @@ bool map_is_location_owned(const CoordsXYZ& loc) } } } - - gGameCommandErrorText = STR_LAND_NOT_OWNED_BY_PARK; return false; } @@ -808,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; } @@ -835,25 +828,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 @@ -861,24 +872,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) @@ -939,8 +968,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) @@ -969,8 +997,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) @@ -1083,10 +1110,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(); @@ -1128,7 +1157,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) @@ -1231,292 +1260,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. * @@ -1589,7 +1332,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) { @@ -1611,7 +1356,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 // @@ -1695,7 +1440,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); } @@ -1709,7 +1454,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); } @@ -1756,7 +1501,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) { @@ -1768,7 +1513,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) { @@ -1780,7 +1525,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) { @@ -1792,7 +1537,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) { @@ -2064,7 +1809,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); } /** @@ -2125,7 +1870,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) @@ -2186,7 +1931,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; @@ -2494,13 +2239,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..38654a35d4 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" @@ -101,11 +100,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 +135,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; @@ -182,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); @@ -223,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); -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); - struct tile_element_iterator { int32_t x; @@ -295,11 +290,9 @@ 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); void FixLandOwnershipTiles(std::initializer_list tiles); -void FixLandOwnershipTilesWithOwnership(std::initializer_list tiles, uint8_t ownership); - -#endif +void FixLandOwnershipTilesWithOwnership( + std::initializer_list tiles, uint8_t ownership, bool doNotDowngrade = false); diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index 5f6d7c467b..f80a5a5271 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()) @@ -337,10 +336,8 @@ static bool map_animation_invalidate_track_onridephoto(const CoordsXYZ& loc) tileElement->AsTrack()->DecrementPhotoTimeout(); return false; } - else - { - return true; - } + + return true; } } while (!(tileElement++)->IsLastForTile()); @@ -585,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, }; /** @@ -640,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/MapGen.cpp b/src/openrct2/world/MapGen.cpp index cefb0081e6..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); @@ -102,8 +103,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/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/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/MoneyEffect.cpp b/src/openrct2/world/MoneyEffect.cpp index 4ff854a571..1e57a997fa 100644 --- a/src/openrct2/world/MoneyEffect.cpp +++ b/src/openrct2/world/MoneyEffect.cpp @@ -18,9 +18,14 @@ #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 SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::MoneyEffect; } @@ -29,7 +34,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,10 +68,10 @@ 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()) + 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. @@ -83,10 +88,10 @@ void MoneyEffect::Create(money32 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); @@ -133,12 +138,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/MoneyEffect.h b/src/openrct2/world/MoneyEffect.h index ba6aa34c81..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; @@ -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); }; diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 1fb1b4db18..ddcec0d235 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -18,13 +18,13 @@ #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" #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" @@ -45,22 +45,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; @@ -87,10 +87,8 @@ static PeepSpawn* get_random_peep_spawn() { return &gPeepSpawns[scenario_rand() % gPeepSpawns.size()]; } - else - { - return nullptr; - } + + return nullptr; } void park_set_open(bool open) @@ -246,12 +244,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; } @@ -303,8 +301,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) @@ -465,15 +463,11 @@ int32_t Park::CalculateParkRating() const // Litter { - int32_t litterCount = 0; - for (auto litter : EntityList()) - { - // Ignore recently dropped litter - if (litter->creationTick - gScenarioTicks >= 7680) - { - litterCount++; - } - } + // 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; }); + result -= 600 - (4 * (150 - std::min(150, litterCount))); } @@ -482,10 +476,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 +491,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; } @@ -742,11 +736,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() @@ -766,21 +757,21 @@ 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(gGuestsInParkHistory, gNumGuestsInPark); + 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..7f27f77076 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -13,11 +13,11 @@ #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(); +constexpr const uint32_t GuestsInParkHistoryUndefined = std::numeric_limits::max(); + enum : uint32_t { PARK_FLAGS_PARK_OPEN = (1 << 0), @@ -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; @@ -87,22 +87,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; 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/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/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 47c3e0366b..c706866b6c 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" @@ -50,10 +51,17 @@ int16_t gSceneryShiftPressZOffset; int16_t gSceneryCtrlPressed; int16_t gSceneryCtrlPressZ; -money32 gClearSceneryCost; +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) { @@ -109,13 +117,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 +150,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; @@ -281,3 +288,109 @@ 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(const ScenerySelection& item) +{ + if (!gCheatsIgnoreResearchStatus) + { + if (!scenery_is_invented(item)) + { + return false; + } + } + + if (!gCheatsSandboxMode) + { + if (IsSceneryItemRestricted(item)) + { + return false; + } + } + + return true; +} + +static size_t GetMaxObjectsForSceneryType(const 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(const 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(const ScenerySelection& item) +{ + return std::find(std::begin(_restrictedScenery), std::end(_restrictedScenery), item) != std::end(_restrictedScenery); +} + +void ClearRestrictedScenery() +{ + _restrictedScenery.clear(); +} + +std::vector& GetRestrictedScenery() +{ + return _restrictedScenery; +} + +void RestrictAllMiscScenery() +{ + std::vector nonMiscScenery; + for (ObjectEntryIndex i = 0; i < MAX_SCENERY_GROUP_OBJECTS; i++) + { + const 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++) + { + const auto maxObjects = GetMaxObjectsForSceneryType(sceneryType); + for (ObjectEntryIndex i = 0; i < maxObjects; i++) + { + const ScenerySelection sceneryItem = { sceneryType, i }; + const auto* sceneryEntry = GetSceneryEntry(sceneryItem); + if (sceneryEntry != nullptr) + { + 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 b26027cb3b..6b678e6ad1 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" @@ -132,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 @@ -277,7 +281,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); @@ -291,4 +295,9 @@ rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex); int32_t wall_entry_get_door_sound(const WallSceneryEntry* wallEntry); -#endif +bool IsSceneryAvailableToBuild(const ScenerySelection& item); + +bool IsSceneryItemRestricted(const 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_limitsGetType() != 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_small_entry_has_flag(scenery, SMALL_SCENERY_FLAG_IS_TREE)) - return 1; - } - - if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) - *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); -} - -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 +69,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); diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 8c0a36a03f..455b55a6b6 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -17,6 +17,8 @@ #include "../core/MemoryStream.h" #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" @@ -43,33 +45,30 @@ constexpr const uint32_t SPATIAL_INDEX_LOCATION_NULL = SPATIAL_INDEX_SIZE - 1; static std::array, SPATIAL_INDEX_SIZE> gSpriteSpatialIndex; -constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y) +static void FreeEntity(EntityBase& entity); + +static constexpr size_t GetSpatialIndexOffset(const CoordsXY& loc) { - size_t index = SPATIAL_INDEX_LOCATION_NULL; - if (x != LOCATION_NULL) - { - x = std::clamp(x, 0, 0xFFFF); - y = std::clamp(y, 0, 0xFFFF); - - int16_t flooredX = floor2(x, 32); - uint8_t tileY = y >> 5; - index = (flooredX << 3) | tileY; - } - - if (index >= sizeof(gSpriteSpatialIndex)) - { + if (loc.IsNull()) return SPATIAL_INDEX_LOCATION_NULL; - } - return index; + + // 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 (tileX >= MAXIMUM_MAP_SIZE_TECHNICAL || tileY >= MAXIMUM_MAP_SIZE_TECHNICAL) + return SPATIAL_INDEX_LOCATION_NULL; + + return tileX * MAXIMUM_MAP_SIZE_TECHNICAL + tileY; } // 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; } @@ -93,22 +92,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; } @@ -138,12 +137,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) { @@ -155,12 +154,12 @@ SpriteBase* get_sprite(size_t spriteIndex) const std::vector& GetEntityTileList(const CoordsXY& spritePos) { - return gSpriteSpatialIndex[GetSpatialIndexOffset(spritePos.x, spritePos.y)]; + return gSpriteSpatialIndex[GetSpatialIndexOffset(spritePos)]; } -void SpriteBase::Invalidate() +void EntityBase::Invalidate() { - if (sprite_left == LOCATION_NULL) + if (x == LOCATION_NULL) return; int32_t maxZoom = 0; @@ -193,7 +192,7 @@ void SpriteBase::Invalidate() break; } - viewports_invalidate(sprite_left, sprite_top, sprite_right, sprite_bottom, maxZoom); + viewports_invalidate(SpriteRect, maxZoom); } static void ResetEntityLists() @@ -225,7 +224,8 @@ 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); @@ -233,7 +233,19 @@ void reset_sprite_list() { 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) + { + auto* spr = GetEntity(i); + if (spr == nullptr) + { + continue; + } spr->Type = EntityType::Null; spr->sprite_index = i; @@ -244,7 +256,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); /** * @@ -302,20 +314,21 @@ 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; _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; } 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 @@ -328,7 +341,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); @@ -350,7 +363,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. @@ -365,12 +378,12 @@ static void PrepareNewEntity(SpriteBase* 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 }); } -SpriteBase* CreateEntity(EntityType type) +EntityBase* CreateEntity(EntityType type) { if (_freeIdList.size() == 0) { @@ -402,7 +415,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) @@ -447,17 +460,17 @@ 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); + 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); } -static void SpriteSpatialRemove(SpriteBase* sprite) +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) @@ -471,10 +484,10 @@ 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); + size_t newIndex = GetSpatialIndexOffset(newLoc); + size_t currentIndex = GetSpatialIndexOffset({ sprite->x, sprite->y }); if (newIndex == currentIndex) return; @@ -482,7 +495,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) { @@ -500,7 +513,6 @@ void SpriteBase::MoveTo(const CoordsXYZ& newLocation) if (loc.x == LOCATION_NULL) { - sprite_left = LOCATION_NULL; x = loc.x; y = loc.y; z = loc.z; @@ -512,42 +524,55 @@ 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); - 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->x = spritePos.x; - sprite->y = spritePos.y; - sprite->z = spritePos.z; + sprite->SpriteRect = ScreenRect( + screenCoords - ScreenCoordsXY{ sprite->sprite_width, sprite->sprite_height_negative }, + screenCoords + ScreenCoordsXY{ sprite->sprite_width, sprite->sprite_height_positive }); + sprite->SetLocation(spritePos); +} + +/** + * Frees any dynamically attached memory to the entity, such as peep name. + */ +static void FreeEntity(EntityBase& entity) +{ + auto* guest = entity.As(); + auto* staff = entity.As(); + if (staff != nullptr) + { + staff->SetName({}); + staff->ClearPatrolArea(); + } + 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) +void sprite_remove(EntityBase* sprite) { - auto peep = sprite->As(); - if (peep != nullptr) - { - peep->SetName({}); - } + FreeEntity(*sprite); EntityTweener::Get().RemoveEntity(sprite); RemoveFromEntityList(sprite); // remove from existing list @@ -585,13 +610,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 6ac0545b30..c148046607 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -7,11 +7,10 @@ * 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" +#include "EntityBase.h" #include @@ -23,7 +22,12 @@ union rct_sprite { uint8_t pad_00[0x200]; - SpriteBase base; + EntityBase base; + // Provide a constructor as EntityBase is not trivialy constructable + rct_sprite() + : pad_00() + { + } }; assert_struct_size(rct_sprite, 0x200); @@ -39,13 +43,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); - -#endif +void sprite_set_flashing(EntityBase* sprite, bool flashing); +bool sprite_get_flashing(EntityBase* sprite); 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/TileElement.h b/src/openrct2/world/TileElement.h index 7efd8744a7..893b3f06b5 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,34 +263,35 @@ struct PathElement : TileElementBase static constexpr TileElementType ElementType = TileElementType::Path; private: - PathSurfaceIndex SurfaceIndex; // 5 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-private-field" - PathRailingsIndex 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: - PathSurfaceIndex GetSurfaceEntryIndex() const; - PathSurfaceEntry* GetSurfaceEntry() const; - void SetSurfaceEntryIndex(PathSurfaceIndex newIndex); + ObjectEntryIndex GetLegacyPathEntryIndex() const; + const FootpathObject* GetLegacyPathEntry() const; + void SetLegacyPathEntryIndex(ObjectEntryIndex newIndex); + bool HasLegacyPathEntry() const; - PathRailingsIndex GetRailingEntryIndex() const; - PathRailingsEntry* GetRailingEntry() const; - void SetRailingEntryIndex(PathRailingsIndex newIndex); + 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; uint8_t GetQueueBannerDirection() const; void SetQueueBannerDirection(uint8_t direction); @@ -374,15 +378,15 @@ private: }; uint8_t Flags2; ride_id_t RideIndex; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-private-field" - uint8_t pad[2]; -#pragma clang diagnostic pop + ride_type_t RideType; public: track_type_t GetTrackType() const; void SetTrackType(track_type_t newEntryIndex); + ride_type_t GetRideType() const; + void SetRideType(const ride_type_t rideType); + uint8_t GetSequenceIndex() const; void SetSequenceIndex(uint8_t newSequenceIndex); @@ -569,11 +573,12 @@ private: uint8_t entranceType; // 5 uint8_t SequenceIndex; // 6. Only uses the lower nibble. uint8_t StationIndex; // 7 - PathSurfaceIndex PathType; // 8 - ride_id_t rideIndex; // 9 + ObjectEntryIndex PathType; // 8 + 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: @@ -589,8 +594,19 @@ public: uint8_t GetSequenceIndex() const; void SetSequenceIndex(uint8_t newSequenceIndex); - PathSurfaceIndex GetPathType() const; - void SetPathType(PathSurfaceIndex newPathType); + 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; }; assert_struct_size(EntranceElement, 16); 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 diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 7dbb1dec4f..01698c85bd 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) @@ -95,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) { @@ -106,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; @@ -207,11 +208,11 @@ 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(); - 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) @@ -255,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); @@ -283,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()) { @@ -361,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); @@ -373,17 +374,18 @@ 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, STR_NONE); } - 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 @@ -421,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; @@ -481,17 +483,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); @@ -503,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) @@ -555,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) { @@ -581,54 +583,42 @@ 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) { 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) @@ -646,24 +636,12 @@ 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) { 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); @@ -681,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) { @@ -703,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) { @@ -725,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) { @@ -748,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) { @@ -788,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) { @@ -812,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) { @@ -840,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) { @@ -852,9 +830,10 @@ 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); - auto trackBlock = TrackBlocks[type]; + const auto& ted = GetTrackElementDescriptor(type); + const auto* trackBlock = ted.Block; trackBlock += trackElement->AsTrack()->GetSequenceIndex(); uint8_t originDirection = trackElement->GetDirection(); @@ -866,7 +845,7 @@ namespace OpenRCT2::TileInspector originY = static_cast(coords.y); originZ -= trackBlock->z; - trackBlock = TrackBlocks[type]; + trackBlock = ted.Block; for (; trackBlock->index != 255; trackBlock++) { CoordsXYZD elem = { originX, originY, originZ + trackBlock->z, rotation }; @@ -878,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 @@ -912,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) { @@ -935,9 +914,10 @@ 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); - auto trackBlock = TrackBlocks[type]; + const auto& ted = GetTrackElementDescriptor(type); + auto trackBlock = ted.Block; trackBlock += trackElement->AsTrack()->GetSequenceIndex(); uint8_t originDirection = trackElement->GetDirection(); @@ -949,7 +929,7 @@ namespace OpenRCT2::TileInspector originY = static_cast(coords.y); originZ -= trackBlock->z; - trackBlock = TrackBlocks[type]; + trackBlock = ted.Block; for (; trackBlock->index != 255; trackBlock++) { CoordsXYZD elem = { originX, originY, originZ + trackBlock->z, rotation }; @@ -961,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 @@ -993,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) { @@ -1016,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) { @@ -1039,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) { @@ -1066,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) { @@ -1090,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) { @@ -1112,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) { @@ -1131,4 +1111,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..0f204f8bf5 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); @@ -28,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); 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/Compat.cpp b/test/testpaint/Compat.cpp index 7c2f408090..4bd8633928 100644 --- a/test/testpaint/Compat.cpp +++ b/test/testpaint/Compat.cpp @@ -9,6 +9,7 @@ #include "Addresses.h" +#include #include #include #include @@ -33,7 +34,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; @@ -73,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; @@ -212,7 +219,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; } @@ -887,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 }; +} 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_ 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..f6d54f6321 --- /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 TestEnumClassContinuous +{ + A, + B, + C, + D, + E, + F, + G +}; + +enum class TestEnumClassNonContinuous +{ + 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, LookupContinuousByKey) +{ + TestEnumKeyLookup(); +} + +TEST(EnumMapTest, LookupContinuousByValue) +{ + TestEnumValueLookup(); +} + +TEST(EnumMapTest, LookupNonContinuousByKey) +{ + TestEnumKeyLookup(); +} + +TEST(EnumMapTest, LookupNonContinuousByValue) +{ + TestEnumValueLookup(); +} 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" diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index df55e74b3e..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" @@ -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). @@ -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); 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..5741842e01 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); @@ -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 1a72af0ddb..027c60d5d8 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 @@ -495,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, +}; 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 @@ +